feat(LOY-105): update signup form validation messages * feat(LOY-105): improve signup form validation messages Approved-by: Erik Tiekstra
16 lines
449 B
TypeScript
16 lines
449 B
TypeScript
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
|
|
}
|
|
}
|