18 lines
426 B
TypeScript
18 lines
426 B
TypeScript
import { apiClient } from '@/services/api/client';
|
|
|
|
export interface Role {
|
|
id: string;
|
|
name: string;
|
|
permissions: string[];
|
|
}
|
|
|
|
export const roleService = {
|
|
list: async () => {
|
|
const response = await apiClient.get<{ roles: Role[] }>('/roles');
|
|
return response.data;
|
|
},
|
|
get: async (id: string) => {
|
|
const response = await apiClient.get<{ role: Role }>(`/roles/${id}`);
|
|
return response.data;
|
|
},
|
|
};
|