Add admin state store, add new role functionality
This commit is contained in:
parent
7369167e28
commit
dc0fdee030
10 changed files with 202 additions and 17 deletions
12
resources/scripts/api/admin/roles/createRole.ts
Normal file
12
resources/scripts/api/admin/roles/createRole.ts
Normal 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);
|
||||
});
|
||||
};
|
|
@ -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[]> => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue