mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 16:35:24 +02:00
Detect ASIN column index dynamically from headers
This commit is contained in:
@@ -77,6 +77,14 @@ export default function App() {
|
|||||||
const rawHeaders = data[0];
|
const rawHeaders = data[0];
|
||||||
const rawRows = data.slice(1);
|
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...');
|
console.log('Applying Supabase overrides...');
|
||||||
const syncedData = await getAllSyncedRows();
|
const syncedData = await getAllSyncedRows();
|
||||||
const articleNoIdx = COLUMNS.ARTICLE_NO;
|
const articleNoIdx = COLUMNS.ARTICLE_NO;
|
||||||
|
|||||||
Reference in New Issue
Block a user