mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 15:35:23 +02:00
Fix silent failure on getAllSyncedRows by forcing anon key
This commit is contained in:
+6
-2
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user