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 {};