feat: add server modules (audit, upload, email, content, tracking)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { db } from './db';
|
||||
import { auditLog } from './schema';
|
||||
|
||||
export async function logAudit(params: {
|
||||
userId?: number;
|
||||
action: string;
|
||||
entity?: string;
|
||||
entityId?: number;
|
||||
diff?: Record<string, unknown>;
|
||||
ipAddress?: string;
|
||||
}): Promise<void> {
|
||||
await db.insert(auditLog).values({
|
||||
userId: params.userId ?? null,
|
||||
action: params.action,
|
||||
entity: params.entity ?? null,
|
||||
entityId: params.entityId ?? null,
|
||||
diff: params.diff ?? null,
|
||||
ipAddress: params.ipAddress ?? null
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user