fix: extrapolate phone number parsing for re-usage in edit profile

move error messages to message handler
This commit is contained in:
Christian Andolf
2025-06-12 16:45:26 +02:00
parent e645b15c6e
commit 9da986f554
11 changed files with 62 additions and 45 deletions

View File

@@ -4,6 +4,7 @@ import { signupErrors } from "@/components/Forms/Signup/schema"
import { multiroomErrors } from "@/components/HotelReservation/EnterDetails/Details/Multiroom/schema"
import { roomOneErrors } from "@/components/HotelReservation/EnterDetails/Details/RoomOne/schema"
import { findMyBookingErrors } from "@/components/HotelReservation/FindMyBooking/schema"
import { phoneErrors } from "@/utils/zod/phoneValidator"
import type { IntlShape } from "react-intl"
@@ -75,6 +76,11 @@ export function getErrorMessage(intl: IntlShape, errorCode?: string) {
return intl.formatMessage({
defaultMessage: "Phone is required",
})
case phoneErrors.PHONE_NUMBER_TOO_SHORT:
return intl.formatMessage({
defaultMessage: "The number you have entered is too short",
})
case phoneErrors.PHONE_REQUESTED:
case signupErrors.PHONE_REQUESTED:
case multiroomErrors.PHONE_REQUESTED:
case roomOneErrors.PHONE_REQUESTED: