fiddy/apps/web/lib/client/group-audit.ts
2026-02-11 23:45:15 -08:00

21 lines
538 B
TypeScript

import { fetchJson } from "@/lib/client/fetch-json";
export type GroupAuditEvent = {
id: number;
groupId: number;
actorUserId: number | null;
actorRole: string | null;
eventType: string;
requestId: string;
ip: string | null;
userAgent: string | null;
success: boolean;
errorCode: string | null;
metadata: Record<string, unknown>;
createdAt: string;
};
export async function groupAuditList() {
return fetchJson<{ events: GroupAuditEvent[] }>("/api/groups/audit", { method: "GET" });
}