Add admin state store, add new role functionality

This commit is contained in:
Matthew Penner 2020-12-28 10:08:08 -07:00
parent 7369167e28
commit dc0fdee030
10 changed files with 202 additions and 17 deletions

View file

@ -0,0 +1,12 @@
import { Role } from '@/api/admin/roles/getRoles';
import http from '@/api/http';
export default (name: string, description?: string): Promise<Role> => {
return new Promise((resolve, reject) => {
http.post('/api/application/roles', {
name, description,
})
.then(({ data }) => resolve(data))
.catch(reject);
});
};

View file

@ -1,9 +1,10 @@
import http from '@/api/http';
export interface Role {
id: number,
name: string,
description: string|null,
id: number;
name: string;
description: string | null;
sortId: number;
}
export default (): Promise<Role[]> => {