Fix silent failure on getAllSyncedRows by forcing anon key

This commit is contained in:
Christian Vidal Wolf
2026-04-10 19:52:30 +02:00
parent d3c90120f4
commit d9cc1f4506
+6 -2
View File
@@ -16,12 +16,16 @@ export async function getAllSyncedRows(token?: string): Promise<Record<string, S
cache: 'no-store', cache: 'no-store',
headers: { headers: {
'apikey': SUPABASE_KEY, 'apikey': SUPABASE_KEY,
'Authorization': `Bearer ${token || SUPABASE_KEY}` 'Authorization': `Bearer ${SUPABASE_KEY}`
} }
} }
); );
if (!response.ok) return {}; if (!response.ok) {
const errText = await response.text();
console.error('getAllSyncedRows failed:', response.status, errText);
return {};
}
const rows = await response.json(); const rows = await response.json();
const result: Record<string, SyncedRow> = {}; const result: Record<string, SyncedRow> = {};
for (const row of rows) { for (const row of rows) {