Merged in fix/clear-guest-form (pull request #3168)
fix(STAY-120): Avoid prefilling edit guest details form in MyStay * fix: Avoid prefilling edit guest details form in MyStay fix: Avoid prefilling edit guest details form in MyStay Approved-by: Erik Tiekstra Approved-by: Elin Svedin Approved-by: Linus Flood
This commit is contained in:
@@ -12,6 +12,8 @@ import { ancillaryError } from "@/components/HotelReservation/MyStay/Ancillaries
|
||||
|
||||
import type { IntlShape } from "react-intl"
|
||||
|
||||
import { editGuestDetailsErrors } from "@/types/components/hotelReservation/myStay/modifyContact"
|
||||
|
||||
export function getErrorMessage(intl: IntlShape, errorCode?: string) {
|
||||
switch (errorCode) {
|
||||
case ancillaryError.MIN_QUANTITY_NOT_REACHED:
|
||||
@@ -72,11 +74,13 @@ export function getErrorMessage(intl: IntlShape, errorCode?: string) {
|
||||
case multiroomErrors.EMAIL_REQUIRED:
|
||||
case roomOneErrors.EMAIL_REQUIRED:
|
||||
case signupErrors.EMAIL_REQUIRED:
|
||||
case editGuestDetailsErrors.EMAIL_REQUIRED:
|
||||
return intl.formatMessage({
|
||||
id: "error.emailRequired",
|
||||
defaultMessage: "Email address is required",
|
||||
})
|
||||
case signupErrors.EMAIL_INVALID:
|
||||
case editGuestDetailsErrors.EMAIL_INVALID:
|
||||
return intl.formatMessage({
|
||||
id: "error.emailInvalid",
|
||||
defaultMessage: "Email address is invalid",
|
||||
@@ -93,6 +97,7 @@ export function getErrorMessage(intl: IntlShape, errorCode?: string) {
|
||||
case multiroomErrors.PHONE_REQUIRED:
|
||||
case roomOneErrors.PHONE_REQUIRED:
|
||||
case editProfileErrors.PHONE_REQUIRED:
|
||||
case editGuestDetailsErrors.PHONE_REQUIRED:
|
||||
return intl.formatMessage({
|
||||
id: "error.phoneRequired",
|
||||
defaultMessage: "Phone is required",
|
||||
@@ -107,6 +112,7 @@ export function getErrorMessage(intl: IntlShape, errorCode?: string) {
|
||||
case multiroomErrors.PHONE_REQUESTED:
|
||||
case roomOneErrors.PHONE_REQUESTED:
|
||||
case editProfileErrors.PHONE_REQUESTED:
|
||||
case editGuestDetailsErrors.PHONE_REQUESTED:
|
||||
return intl.formatMessage({
|
||||
id: "error.phoneRequested",
|
||||
defaultMessage: "Please enter a valid phone number",
|
||||
|
||||
Reference in New Issue
Block a user