From 21aea22e487261154a099996fb6721f7530030b7 Mon Sep 17 00:00:00 2001 From: Bianca Widstam Date: Mon, 17 Mar 2025 10:59:17 +0000 Subject: [PATCH] Merged in fix/api-change-remove-points-packages (pull request #1547) Fix/api change remove points packages * fix/remove-points * fix: translate if points is currency Approved-by: Niclas Edenvin Approved-by: Simon.Emanuelsson --- .../Ancillaries/AddedAncillaries/index.tsx | 29 ++++--------------- .../server/routers/booking/output.ts | 2 -- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddedAncillaries/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddedAncillaries/index.tsx index 97bc13c6f..34b9fc5bf 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddedAncillaries/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddedAncillaries/index.tsx @@ -66,19 +66,9 @@ export function AddedAncillaries({
{intl.formatMessage({ id: "Total" })} - {`${ancillary.totalPrice} ${ancillary.currency}`} - - - - {intl.formatMessage( - { id: "{value} points" }, - { - value: ancillary.points, - } - )} + {ancillary.currency.toLowerCase() === "points" + ? `${ancillary.totalPrice} ${intl.formatMessage({ id: "Points" })}` + : `${ancillary.totalPrice} ${ancillary.currency}`}
@@ -121,16 +111,9 @@ export function AddedAncillaries({
{intl.formatMessage({ id: "Total" })} - {`${ancillary.totalPrice} ${ancillary.currency}`} - - - - {intl.formatMessage( - { id: "{value} points" }, - { - value: ancillary.points, - } - )} + {ancillary.currency.toLowerCase() === "points" + ? `${ancillary.totalPrice} ${intl.formatMessage({ id: "Points" })}` + : `${ancillary.totalPrice} ${ancillary.currency}`}
diff --git a/apps/scandic-web/server/routers/booking/output.ts b/apps/scandic-web/server/routers/booking/output.ts index 5f6b4c3d2..a6e2654dd 100644 --- a/apps/scandic-web/server/routers/booking/output.ts +++ b/apps/scandic-web/server/routers/booking/output.ts @@ -93,7 +93,6 @@ export const packageSchema = z totalPrice: z.number().nullable(), totalUnit: z.number().int().nullable(), currency: z.string().default(""), - points: z.number().int().nullable(), }), comment: z.string().nullable().optional(), }) @@ -103,7 +102,6 @@ export const packageSchema = z comment: packageData.comment, code: packageData.code, currency: packageData.price.currency, - points: packageData.price.points, totalPrice: packageData.price.totalPrice ?? 0, totalUnit: packageData.price.totalUnit ?? 0, unit: packageData.price.unit ?? 0,