feat: add validation for updating email on use profile (#391)

This commit is contained in:
Iniubong Obonguko
2024-07-16 06:35:34 +01:00
committed by GitHub
parent 45b6299de2
commit 1f0e7c7563
3 changed files with 24 additions and 0 deletions
@@ -271,6 +271,14 @@ export const updateOrgSiteNameValidation = (siteName) => {
return processErrors(error);
};
export const updateProfileEmailValidation = (email) => {
const schema = z.object({
email: z.string().email({ message: `${t.get('validations.user_profile.email')}` })
});
const { error } = schema.safeParse({ email });
return processErrors(error);
};
export const createQuizValidation = (fields = {}) => {
const { error } = createQuizValidationSchema.safeParse(fields);