misc_pterodactyl-panel/resources/scripts/api/admin/roles/getRoles.ts

16 lines
334 B
TypeScript
Raw Normal View History

2020-10-04 20:25:58 +00:00
import http from '@/api/http';
export interface Role {
id: number,
name: string,
description: string|null,
}
export default (): Promise<Role[]> => {
return new Promise((resolve, reject) => {
http.get('/admin/roles')
.then(({ data }) => resolve(data || []))
.catch(reject);
});
};