Add handler to fetch all of the system permissions and load them into the state
This commit is contained in:
parent
867dbf3bd2
commit
d69f816d9d
8 changed files with 106 additions and 6 deletions
10
resources/scripts/api/getSystemPermissions.ts
Normal file
10
resources/scripts/api/getSystemPermissions.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { SubuserPermission } from '@/state/server/subusers';
|
||||
import http from '@/api/http';
|
||||
|
||||
export default (): Promise<SubuserPermission[]> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.get(`/api/client/permissions`)
|
||||
.then(({ data }) => resolve(data.attributes.permissions))
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
Reference in a new issue