From 3a3e0b3e27de06e826c6d970c4db26f5317e7155 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 7 Oct 2026 10:22:30 +0000 Subject: [PATCH] fix(api): satisfy typecheck for focusFactValue Co-authored-by: cynarAI --- apps/api/src/onboarding-intake.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/api/src/onboarding-intake.ts b/apps/api/src/onboarding-intake.ts index 29ed239..ec91ff8 100644 --- a/apps/api/src/onboarding-intake.ts +++ b/apps/api/src/onboarding-intake.ts @@ -69,7 +69,8 @@ const FOCUS_FACTS: Record> = { export function focusFactValue(focusId: string, locale: string): string { const id = focusId as FocusOption["id"]; const key = locale.toLowerCase().startsWith("de") ? "de" : "en"; - return FOCUS_FACTS[key][id] ?? FOCUS_FACTS.en[id]; + const table = FOCUS_FACTS[key]; + return table[id] ?? FOCUS_FACTS.en[id] ?? focusId; } export const FOCUS_OPTIONS: FocusOption[] = [ @@ -135,7 +136,7 @@ export const INTAKE_STEPS: IntakeStep[] = [ if (!option) return; const profile = await tx.userProfile.findUnique({ where: { userId }, - select: { locale: true, language: true }, + select: { locale: true, timeZone: true }, }); const locale = intakeContext(profile, new Date()).locale; await tx.userOnboarding.update({ where: { userId }, data: { focus: option.id } });