fix: avoid localizing currencies and default missing value to N/A

This commit is contained in:
Christel Westerberg
2025-01-07 15:48:44 +01:00
parent 5018cba623
commit a3331850a2
12 changed files with 22 additions and 68 deletions

View File

@@ -1,15 +1,11 @@
import deepmerge from "deepmerge"
import isEqual from "fast-deep-equal"
import { Lang } from "@/constants/languages"
import { getLang } from "@/i18n/serverContext"
import { arrayMerge } from "@/utils/merge"
import { detailsStorageName } from "."
import type { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate"
import { CurrencyEnum } from "@/types/enums/currency"
import type { StepEnum } from "@/types/enums/step"
import type {
DetailsState,
@@ -19,24 +15,6 @@ import type {
} from "@/types/stores/enter-details"
import type { SafeUser } from "@/types/user"
export function langToCurrency() {
const lang = getLang()
switch (lang) {
case Lang.da:
return CurrencyEnum.DKK
case Lang.de:
case Lang.en:
case Lang.fi:
return CurrencyEnum.EUR
case Lang.no:
return CurrencyEnum.NOK
case Lang.sv:
return CurrencyEnum.SEK
default:
throw new Error(`Unexpected lang: ${lang}`)
}
}
export function extractGuestFromUser(user: NonNullable<SafeUser>) {
return {
countryCode: user.address.countryCode?.toString(),