Fix: Add error handling to audit logger
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user