Display the list of registered keys

This commit is contained in:
2021-05-14 14:47:13 +02:00
parent 41d568e493
commit 7ac554e90e
4 changed files with 191 additions and 43 deletions

View File

@@ -33,6 +33,12 @@ export interface NewAdminGeneralSettings {
email: string;
}
export interface AdminAccountKey {
id: number;
name: string;
time_add: number;
}
const SESSION_STORAGE_TOKEN = "auth_token";
let currentAccount: AdminAccount | null = null;
@@ -248,4 +254,15 @@ export class AccountHelper {
sessionStorage.setItem(SESSION_STORAGE_TOKEN, res.token);
}
/**
* Get the list of keys of an admin
*
* @param adminID The id of the target administrator
*/
static async GetAdminKeys(adminID: number): Promise<AdminAccountKey[]> {
return await serverRequest("accounts/keys", {
id: adminID,
});
}
}