fix(api): satisfy typecheck for focusFactValue

Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
This commit is contained in:
Cursor Agent 2026-10-07 10:22:30 +00:00
parent 5387b38e54
commit 3a3e0b3e27
No known key found for this signature in database

View File

@ -69,7 +69,8 @@ const FOCUS_FACTS: Record<string, Record<FocusOption["id"], string>> = {
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 } });