mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 13:35:25 +02:00
feat: persistent validation visibility in DimensionsView and selection fixes
This commit is contained in:
+10
-1
@@ -21,6 +21,9 @@ export async function saveRowToSupabase(articleNo: string, rowData: ExcelRow) {
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => ({}));
|
||||
console.error('Initial PATCH failed:', response.status, errorData);
|
||||
|
||||
// If PATCH didn't find the record, try UPSERT
|
||||
const upsertResponse = await fetch(`${SUPABASE_URL}/rest/v1/products_sync`, {
|
||||
method: 'POST',
|
||||
@@ -37,7 +40,13 @@ export async function saveRowToSupabase(articleNo: string, rowData: ExcelRow) {
|
||||
updated_at: new Date().toISOString()
|
||||
})
|
||||
});
|
||||
return upsertResponse.ok;
|
||||
|
||||
if (!upsertResponse.ok) {
|
||||
const upsertError = await upsertResponse.json().catch(() => ({}));
|
||||
console.error('UPSERT failed:', upsertResponse.status, upsertError);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user