From 4a6440f58af159d311132b29d1ffb29470d1f778 Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Thu, 9 Apr 2026 16:29:54 +0200 Subject: [PATCH] Detect ASIN column index dynamically from headers --- src/App.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index 4b34794..58f46c0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -77,6 +77,14 @@ export default function App() { const rawHeaders = data[0]; const rawRows = data.slice(1); + // Find ASIN column index from headers (case insensitive) + const asinIdx = (rawHeaders as string[]).findIndex((h: string) => + String(h).toLowerCase().trim() === 'asin' + ); + if (asinIdx !== -1) { + console.log('ASIN column found at index:', asinIdx); + } + console.log('Applying Supabase overrides...'); const syncedData = await getAllSyncedRows(); const articleNoIdx = COLUMNS.ARTICLE_NO;