From 8fc70fa162f4d2524689c7d9b96e09bbaddd7fb7 Mon Sep 17 00:00:00 2001 From: arc-alex Date: Sun, 26 Nov 2023 14:23:12 +0100 Subject: [PATCH] cellRequenstFromEvent change --- apps/server/src/utils/sheetsAuth.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/apps/server/src/utils/sheetsAuth.ts b/apps/server/src/utils/sheetsAuth.ts index ced4b5872..39ce70ae7 100644 --- a/apps/server/src/utils/sheetsAuth.ts +++ b/apps/server/src/utils/sheetsAuth.ts @@ -133,17 +133,10 @@ class sheet { }, }); - //TODO: this is a mess - const titleCol = Object.values(rundownMetadata) - // .filter(([key, value]) => value !== undefined) - .reduce((accumulator: number, val) => Math.min(accumulator, val['col']), Number.MAX_VALUE); - if (titleCol == Number.MAX_VALUE) { - throw new Error(`could not finde starting title column`); - } //update the corespunding row with event data rundown.forEach((entry, index) => updateRundown.push( - cellRequenstFromEvent(entry, index, this.worksheetId, rundownMetadata, titleCol as number), + cellRequenstFromEvent(entry, index, this.worksheetId, rundownMetadata), ), ); const writeResponds = await sheets({ version: 'v4', auth: sheet.client }).spreadsheets.batchUpdate({