From b87f024b7d57c9df4a7c8ffde50cfa680edf1f39 Mon Sep 17 00:00:00 2001 From: Kenan KARAER Date: Wed, 3 Dec 2025 23:12:35 +0300 Subject: [PATCH] Debug: Add logging to Audit Logs page to diagnose empty list --- src/app/dashboard/settings/logs/page.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app/dashboard/settings/logs/page.tsx b/src/app/dashboard/settings/logs/page.tsx index 0074504..49af713 100644 --- a/src/app/dashboard/settings/logs/page.tsx +++ b/src/app/dashboard/settings/logs/page.tsx @@ -22,8 +22,9 @@ export default async function AuditLogsPage() { // Use admin client if available to bypass RLS for debugging const client = supabaseAdmin || supabase + console.log("AuditLogsPage: Using admin client?", !!supabaseAdmin) - const { data: logs } = await client + const { data: logs, error } = await client .from('audit_logs') .select(` *, @@ -32,6 +33,12 @@ export default async function AuditLogsPage() { .order('created_at', { ascending: false }) .limit(50) + if (error) { + console.error("AuditLogsPage: Error fetching logs:", error) + } else { + console.log("AuditLogsPage: Fetched logs count:", logs?.length) + } + const getActionBadge = (action: string) => { if (action.includes('create')) return Oluşturma if (action.includes('update')) return Güncelleme