Fix: Add error handling to audit logger

This commit is contained in:
2025-12-03 22:59:48 +03:00
parent 80baa907ab
commit df778f11bf

View File

@@ -11,11 +11,18 @@ export async function logAction(
if (!user) return
await supabase.from('audit_logs').insert({
try {
const { error } = await supabase.from('audit_logs').insert({
user_id: user.id,
action,
entity_type: entityType,
entity_id: entityId,
details,
})
if (error) {
console.error("Audit log error:", error)
}
} catch (err) {
console.error("Audit log exception:", err)
}
}