Merged in fix/STAY-73-opt-in-email (pull request #3028)

Fix/STAY-73 opt in email

* fix: let user opt-in for modification email when adding ancillaries

* fix: add toast when successfully removing an ancillary


Approved-by: Erik Tiekstra
Approved-by: Elin Svedin
This commit is contained in:
Christel Westerberg
2025-10-29 12:45:18 +00:00
parent 333636c81a
commit 377c8886ad
8 changed files with 53 additions and 4 deletions

View File

@@ -8,11 +8,22 @@ import { signupErrors } from "@scandic-hotels/trpc/routers/user/schemas"
import { editProfileErrors } from "@/components/Forms/Edit/Profile/schema"
import { findMyBookingErrors } from "@/components/HotelReservation/FindMyBooking/schema"
import { ancillaryError } from "@/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/schema"
import type { IntlShape } from "react-intl"
export function getErrorMessage(intl: IntlShape, errorCode?: string) {
switch (errorCode) {
case ancillaryError.MIN_QUANTITY_NOT_REACHED:
return intl.formatMessage({
id: "addAncillary.selectQuantityStep.minQuantityNotReached",
defaultMessage: "You must select at least one quantity",
})
case ancillaryError.TERMS_NOT_ACCEPTED:
return intl.formatMessage({
id: "addAncillary.confirmationStep.termsAndConditionsNotice",
defaultMessage: "You must accept the terms and conditions to proceed",
})
case findMyBookingErrors.BOOKING_NUMBER_INVALID:
return intl.formatMessage({
id: "error.invalidBookingNumber",