Audit log table and modal

This commit is contained in:
Jamie Curnow
2025-09-14 14:00:00 +10:00
parent e44748e46f
commit 2b88f56d22
24 changed files with 425 additions and 12 deletions

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 };