1
0
mirror of https://gitlab.com/comunic/comunicconsole synced 2025-07-16 22:58:05 +00:00

Load the list of roles in memory

This commit is contained in:
2021-05-14 18:51:57 +02:00
parent 5334fd9430
commit 69c68f43cb
4 changed files with 57 additions and 22 deletions

@ -133,7 +133,7 @@ export class AdminKeyHelper {
* @param adminID The id of the target administrator
*/
static async GetAdminKeys(adminID: number): Promise<AdminAccountKey[]> {
return await serverRequest("keys/keys", {
return await serverRequest("keys/list", {
id: adminID,
});
}

@ -0,0 +1,26 @@
/**
* Admin roles helper
*
* @author Pierre Hubert
*/
import { serverRequest } from "./APIHelper";
export interface AdminRole {
id: string;
name: string;
description: string;
}
let RolesList: AdminRole[] = [];
export class AdminRolesHelper {
/**
* Load the list of roles.
*
* @throws In case of failure
*/
static async LoadRolesList() {
RolesList = await serverRequest("roles/list");
}
}