feat: persistent validation visibility in DimensionsView and selection fixes

This commit is contained in:
Christian Vidal Wolf
2026-04-08 20:05:24 +02:00
parent e24e3e5067
commit 72e653e353
2 changed files with 51 additions and 29 deletions
+10 -1
View File
@@ -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) {