fix document 500 error and fix users tabel for bot
This commit is contained in:
@@ -98,6 +98,9 @@ export interface AdminUser {
|
||||
directPermissions?: string[];
|
||||
isVerified?: boolean;
|
||||
verificationIcon?: string | null;
|
||||
isBot?: boolean;
|
||||
linkedBotUsername?: string | null;
|
||||
isSystemBot?: boolean;
|
||||
}
|
||||
|
||||
export interface AdminRole {
|
||||
@@ -1001,6 +1004,19 @@ export async function fetchAdminBotMetrics(token?: string | null) {
|
||||
return apiFetch<AdminBotMetrics>('/admin/bots/metrics', {}, token);
|
||||
}
|
||||
|
||||
export async function fetchAdminBotAccounts(search: string | undefined, token?: string | null) {
|
||||
const suffix = search?.trim() ? `?search=${encodeURIComponent(search.trim())}` : '';
|
||||
return apiFetch<{ users: AdminUser[] }>(`/admin/users/bot-accounts${suffix}`, {}, token);
|
||||
}
|
||||
|
||||
export async function fetchUserTotpStatus(userId: string, token?: string | null) {
|
||||
return apiFetch<TotpStatusResponse>(`/security/users/${userId}/totp/status`, {}, token);
|
||||
}
|
||||
|
||||
export async function adminDisableUserTotp(userId: string, token?: string | null) {
|
||||
return apiFetch<TotpStatusResponse>(`/admin/users/${userId}/totp/admin-disable`, { method: 'POST' }, token);
|
||||
}
|
||||
|
||||
export async function setAdminBotActive(botId: string, isActive: boolean, token?: string | null) {
|
||||
return apiFetch<ManagedBot>(`/admin/bots/${botId}/active`, {
|
||||
method: 'PATCH',
|
||||
|
||||
Reference in New Issue
Block a user