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:
Abubeker Yasin
2026-08-18 16:19:15 +03:00
committed by GitHub
32 changed files with 3068 additions and 420 deletions

View File

@@ -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