import { request } from 'umi' ; export async function queryRoles ( params ? ) { return request ( 'roles' , { params , } ) ; } export async function storeRole ( data ) { return request ( 'roles' , { method : 'POST' , data , } ) ; } export async function updateRole ( id , data ) { return request ( `roles/${ id }` , { method : 'PUT' , data , } ) ; } export async function getRolePermissions ( roleId ) { return request ( `roles/${ roleId }/permissions` ) ; } export async function assignPermissions ( roleId , data ) { return request ( `roles/${ roleId }/assign_permissions` , { method : 'POST' , data , } ) ; }