fix: remove invalid ip_address and user_agent params from AuditService.log_action calls
This commit is contained in:
@@ -755,6 +755,32 @@ export const api = {
|
||||
},
|
||||
},
|
||||
|
||||
superadmin: {
|
||||
getUserAuditLogs: (userId: string, params?: Record<string, string>, requestConfig?: RequestConfig) =>
|
||||
request<{ audit_logs: AuditLogEntry[]; count: number; page: number; per_page: number; pages: number; user: User }>(
|
||||
`/superadmin/users/${userId}/audit-logs${params ? '?' + new URLSearchParams(params).toString() : ''}`,
|
||||
{},
|
||||
true,
|
||||
requestConfig,
|
||||
),
|
||||
|
||||
exportUserAuditLogs: async (userId: string, params?: Record<string, string>): Promise<void> => {
|
||||
const qs = params ? '?' + new URLSearchParams(params).toString() : '';
|
||||
const token = tokenManager.getToken();
|
||||
const res = await fetch(`${config.api.baseUrl}/superadmin/users/${userId}/audit-logs/export${qs}`, {
|
||||
headers: { 'Authorization': `Bearer ${token}` },
|
||||
});
|
||||
if (!res.ok) throw new ApiError('Export failed', res.status, 'EXPORT_ERROR');
|
||||
const blob = await res.blob();
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = `user_${userId}_audit_logs.csv`;
|
||||
a.click();
|
||||
URL.revokeObjectURL(url);
|
||||
},
|
||||
},
|
||||
|
||||
totp: {
|
||||
// Initiate TOTP enrollment - returns secret, QR code, and backup codes
|
||||
enroll: () =>
|
||||
|
||||
Reference in New Issue
Block a user