Can request admin settings update

This commit is contained in:
2021-05-13 16:58:50 +02:00
parent d02d025418
commit 6dde0f40c4
5 changed files with 428 additions and 206 deletions

View File

@ -17,6 +17,12 @@ export interface AdminAccount {
time_create: number;
}
export interface NewAdminGeneralSettings {
id: number;
name: string;
email: string;
}
const SESSION_STORAGE_TOKEN = "auth_token";
let currentAccount: AdminAccount | null = null;
@ -114,4 +120,17 @@ export class AccountHelper {
sessionStorage.removeItem(SESSION_STORAGE_TOKEN);
document.location.href = document.location.href + "";
}
/**
* Update an admin's settings
*
* @param a New settings
*/
static async UpdateGeneralSettings(s: NewAdminGeneralSettings) {
await serverRequest("admins/update_general_settings", {
id: s.id,
name: s.name,
email: s.email,
});
}
}