- Fix audit_log handler multi-tenant bug: use Extension<TenantContext>
instead of hardcoded default_tenant_id
- Fix sendMessage route mismatch: frontend /messages/send → /messages
- Add POST /users/{id}/roles backend route for role assignment
- Add task.completed event payload: started_by + instance_id for
notification delivery
- Add audit log viewer frontend page (AuditLogViewer.tsx)
- Add language management frontend page (LanguageManager.tsx)
- Add api/auditLogs.ts and api/languages.ts modules
32 lines
766 B
TypeScript
32 lines
766 B
TypeScript
import client from './client';
|
|
import type { PaginatedResponse } from './users';
|
|
|
|
export interface AuditLogItem {
|
|
id: string;
|
|
tenant_id: string;
|
|
action: string;
|
|
resource_type: string;
|
|
resource_id: string;
|
|
user_id: string;
|
|
old_value?: string;
|
|
new_value?: string;
|
|
ip_address?: string;
|
|
user_agent?: string;
|
|
created_at: string;
|
|
}
|
|
|
|
export interface AuditLogQuery {
|
|
resource_type?: string;
|
|
user_id?: string;
|
|
page?: number;
|
|
page_size?: number;
|
|
}
|
|
|
|
export async function listAuditLogs(query: AuditLogQuery = {}) {
|
|
const { data } = await client.get<{ success: boolean; data: PaginatedResponse<AuditLogItem> }>(
|
|
'/audit-logs',
|
|
{ params: { page: query.page ?? 1, page_size: query.page_size ?? 20, ...query } },
|
|
);
|
|
return data.data;
|
|
}
|