mirror of
https://gitlab.com/comunic/comunicconsole
synced 2025-06-20 00:25:19 +00:00
Can request admin settings update
This commit is contained in:
@ -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,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user