Audit log table and modal

This commit is contained in:
Jamie Curnow committed 2025-10-02 08:12:33 +10:00
1 parent 8ad95c5695
commit 429046f32e
24 files changed
+425 -12

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
import { useQuery } from "@tanstack/react-query";
import { type AuditLog, type AuditLogExpansion, getAuditLogs } from "src/api/backend";
const fetchAuditLogs = (expand?: AuditLogExpansion[]) => {
return getAuditLogs(expand);
};
const useAuditLogs = (expand?: AuditLogExpansion[], options = {}) => {
return useQuery<AuditLog[], Error>({
queryKey: ["audit-logs", { expand }],
queryFn: () => fetchAuditLogs(expand),
staleTime: 10 * 1000,
...options,
});
};
export { fetchAuditLogs, useAuditLogs };