Merged in fix/SW-2950-validation-rule-for-zipcode- (pull request #2360)
Fix: SW-2950 Updated zip code validation rule with regex * Fix: SW-2950 Updated zip code validation rule with regex * fix: SW-2950 Removed non-english characters from postal code regex Approved-by: Christian Andolf
This commit is contained in:
@@ -6,6 +6,7 @@ import { phoneValidator } from "@/utils/zod/phoneValidator"
|
||||
export const editProfileErrors = {
|
||||
COUNTRY_REQUIRED: "COUNTRY_REQUIRED",
|
||||
ZIP_CODE_REQUIRED: "ZIP_CODE_REQUIRED",
|
||||
ZIP_CODE_INVALID: "ZIP_CODE_INVALID",
|
||||
PHONE_REQUIRED: "PHONE_REQUIRED",
|
||||
PHONE_REQUESTED: "PHONE_REQUESTED",
|
||||
PASSWORD_NEW_REQUIRED: "PASSWORD_NEW_REQUIRED",
|
||||
@@ -25,7 +26,10 @@ export const editProfileSchema = z
|
||||
})
|
||||
.min(1, editProfileErrors.COUNTRY_REQUIRED),
|
||||
streetAddress: z.string().optional(),
|
||||
zipCode: z.string().min(1, editProfileErrors.ZIP_CODE_REQUIRED),
|
||||
zipCode: z
|
||||
.string()
|
||||
.min(1, editProfileErrors.ZIP_CODE_REQUIRED)
|
||||
.regex(/^[A-Za-z0-9-\s]{1,9}$/g, editProfileErrors.ZIP_CODE_INVALID),
|
||||
}),
|
||||
dateOfBirth: z.string().min(1),
|
||||
email: z.string().email(),
|
||||
|
||||
Reference in New Issue
Block a user