mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
refactor: load RBAC users from API for audit log user filter
Instead of extracting users from log entries, fetch all users with RBAC roles via dedicated endpoint for complete user list.
This commit is contained in:
@@ -49,6 +49,16 @@ export interface UserRoleAssignment {
|
||||
user_telegram_id: number | null;
|
||||
}
|
||||
|
||||
export interface AdminWithRoles {
|
||||
user_id: number;
|
||||
telegram_id: number | null;
|
||||
username: string | null;
|
||||
first_name: string | null;
|
||||
last_name: string | null;
|
||||
email: string | null;
|
||||
role_names: string[];
|
||||
}
|
||||
|
||||
export interface AssignRolePayload {
|
||||
user_id: number;
|
||||
role_id: number;
|
||||
@@ -167,6 +177,13 @@ export const rbacApi = {
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// --- RBAC Users ---
|
||||
|
||||
getRbacUsers: async (): Promise<AdminWithRoles[]> => {
|
||||
const response = await apiClient.get<AdminWithRoles[]>(`${BASE}/users`);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// --- Role Users ---
|
||||
|
||||
getRoleUsers: async (roleId: number): Promise<UserRoleAssignment[]> => {
|
||||
|
||||
Reference in New Issue
Block a user