mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-09 05:58:18 +00:00
Merge pull request #1338 from Tria-plc/alpha
feat: ( audit ) resolve the actor from the session and audit all back…
This commit is contained in:
@@ -380,7 +380,11 @@ export const verifaydaApi = {
|
||||
// Audit API
|
||||
export const auditApi = {
|
||||
getLogs: async (params?: any) => {
|
||||
const query = new URLSearchParams(params as Record<string, string>).toString();
|
||||
// Drop empty filters so a blank search box doesn't send `search=` and match nothing.
|
||||
const entries = Object.entries(params ?? {}).filter(
|
||||
([, v]) => v !== undefined && v !== null && v !== '',
|
||||
);
|
||||
const query = new URLSearchParams(entries as [string, string][]).toString();
|
||||
const response = await apiClient.get<any>(`/audit/logs${query ? `?${query}` : ''}`);
|
||||
if (response?.data) {
|
||||
return Array.isArray(response.data) ? { items: response.data } : response;
|
||||
@@ -388,6 +392,7 @@ export const auditApi = {
|
||||
return Array.isArray(response) ? { items: response } : response;
|
||||
},
|
||||
getLog: (id: string) => apiClient.get<any>(`/audit/logs/${id}`),
|
||||
getVocabulary: () => apiClient.get<any>('/audit/vocabulary'),
|
||||
};
|
||||
|
||||
// Live Tracking API
|
||||
|
||||
Reference in New Issue
Block a user