mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 14:05:25 +02:00
fix: persist CPNP No. across refreshes by saving as 'edited' and restoring in merge
- saveRowToSupabase now accepts optional status param (default 'pending') - CosmeticItemsView saves CPNP with status 'edited' so resetAllPendingRows does not affect it and it survives the startup merge - Re-added CPNP_NO to editableColumns so the merge restores it from Supabase Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
co-authored by
claude-flow
parent
a0b793b797
commit
2961d3f86a
+2
-2
@@ -72,7 +72,7 @@ export async function getAllSyncedRows(): Promise<Record<string, SyncedRow>> {
|
||||
}
|
||||
}
|
||||
|
||||
export async function saveRowToSupabase(articleNo: string, rowData: ExcelRow): Promise<{ success: boolean; error?: string }> {
|
||||
export async function saveRowToSupabase(articleNo: string, rowData: ExcelRow, status: 'pending' | 'edited' | 'synced' = 'pending'): Promise<{ success: boolean; error?: string }> {
|
||||
try {
|
||||
const response = await safeFetch(
|
||||
`${SUPABASE_URL}/rest/v1/products`,
|
||||
@@ -85,7 +85,7 @@ export async function saveRowToSupabase(articleNo: string, rowData: ExcelRow): P
|
||||
body: JSON.stringify({
|
||||
product_id: articleNo,
|
||||
data: rowData,
|
||||
status: 'pending',
|
||||
status,
|
||||
updated_at: new Date().toISOString()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user