Download tasks/linkedin/solution/site/implementation/clone/lib/audit.ts from TIGER-Lab/WebsiteBench: direct link, hf CLI and curl.
- Browser
- Download file 526 Bytes
-
https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/linkedin/solution/site/implementation/clone/lib/audit.ts
- Command line
-
hf download hf://datasets/TIGER-Lab/WebsiteBench/tasks/linkedin/solution/site/implementation/clone/lib/audit.ts
-
curl -L -o audit.ts https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/linkedin/solution/site/implementation/clone/lib/audit.ts
526 Bytes
| import { getDb } from "@/db"; | |
| import { auditLogs } from "@/db/schema"; | |
| export async function writeAuditLog(input: { | |
| tenantId?: string | null; | |
| actorId?: string | null; | |
| action: string; | |
| entityType: string; | |
| entityId: string; | |
| metadata?: Record<string, unknown>; | |
| }) { | |
| await getDb().insert(auditLogs).values({ | |
| tenantId: input.tenantId ?? null, | |
| actorId: input.actorId ?? null, | |
| action: input.action, | |
| entityType: input.entityType, | |
| entityId: input.entityId, | |
| metadata: input.metadata ?? {}, | |
| }); | |
| } | |