From d2638d64e497dfb7f9e44ac754e15d3598f55ebd Mon Sep 17 00:00:00 2001 From: arc-alex Date: Wed, 17 Sep 2025 13:16:46 +0200 Subject: [PATCH] fix: group end elements should only send timertype data nothing else --- .../src/services/sheet-service/sheetUtils.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/server/src/services/sheet-service/sheetUtils.ts b/apps/server/src/services/sheet-service/sheetUtils.ts index 45df0b462..1b43c360d 100644 --- a/apps/server/src/services/sheet-service/sheetUtils.ts +++ b/apps/server/src/services/sheet-service/sheetUtils.ts @@ -154,12 +154,6 @@ function getCellData(key: OntimeEntryCommonKeys | 'blank', entry: OntimeEntry) { return {}; } - // we need to flatten the milestones - if (key.startsWith('custom')) { - const customKey = key.split(':')[1]; - return { userEnteredValue: { stringValue: entry.custom[customKey] } }; - } - // we need to remap the event type to timer type in the case of groups and milestones if (key === 'timerType') { if (isOntimeGroup(entry)) @@ -168,6 +162,17 @@ function getCellData(key: OntimeEntryCommonKeys | 'blank', entry: OntimeEntry) { return { userEnteredValue: { stringValue: entry.timerType } }; } + // all other data is not relevant for the group end entry + if (entry.id.startsWith('group-end')) { + return {}; + } + + // we need to flatten the milestones + if (key.startsWith('custom')) { + const customKey = key.split(':')[1]; + return { userEnteredValue: { stringValue: entry.custom[customKey] } }; + } + // typescript cannot guarantee that the key exists for every entry // so we check for the key existence and assert the type if (!(key in entry)) return {};