first rewrite commit

This commit is contained in:
fuomag9
2025-10-31 20:08:28 +01:00
parent 85d3917f08
commit 315192fb54
605 changed files with 10913 additions and 47794 deletions
+23
View File
@@ -0,0 +1,23 @@
import db from "../db";
export type AuditEvent = {
id: number;
user_id: number | null;
action: string;
entity_type: string;
entity_id: number | null;
summary: string | null;
created_at: string;
};
export function listAuditEvents(limit = 100): AuditEvent[] {
const rows = db
.prepare(
`SELECT id, user_id, action, entity_type, entity_id, summary, created_at
FROM audit_events
ORDER BY created_at DESC
LIMIT ?`
)
.all(limit) as AuditEvent[];
return rows;
}