Merged in fix/LOY-105-signupform-error-messages (pull request #2121)

feat(LOY-105): update signup form validation messages

* feat(LOY-105): improve signup form validation messages


Approved-by: Erik Tiekstra
This commit is contained in:
Chuma Mcphoy (We Ahead)
2025-05-19 07:12:45 +00:00
parent 97964408ab
commit abf48c4152
4 changed files with 35 additions and 7 deletions

View File

@@ -0,0 +1,15 @@
import { signupErrors } from "@/components/Forms/Signup/schema"
import type { IntlShape } from "react-intl"
export function getErrorMessage(intl: IntlShape, errorCode?: string) {
switch (errorCode) {
case signupErrors.TERMS_REQUIRED:
return intl.formatMessage({
defaultMessage: "Terms & conditions must be accepted",
})
default:
console.warn("Error code not supported:", errorCode)
return errorCode
}
}