Add new org improvements
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import get from 'lodash/get';
|
||||
import isNumber from 'lodash/isNumber';
|
||||
import z from 'zod';
|
||||
import { validateEmail } from './validateEmail';
|
||||
@@ -161,6 +160,22 @@ export const onboardingValidation = (fields = {}, step) => {
|
||||
return processErrors(error);
|
||||
};
|
||||
|
||||
export const createOrgValidation = (fields = {}) => {
|
||||
const schema = z.object({
|
||||
orgName: z.string().min(5, {
|
||||
message: 'Must be 5 or more characters long',
|
||||
invalid_type_error: 'Must not be empty'
|
||||
}),
|
||||
siteName: z.string().min(5, {
|
||||
message: 'Must be 5 or more characters long',
|
||||
invalid_type_error: 'Must not be empty'
|
||||
})
|
||||
});
|
||||
const { error } = schema.safeParse(fields);
|
||||
|
||||
return processErrors(error);
|
||||
};
|
||||
|
||||
export const createQuizValidation = (fields = {}) => {
|
||||
const { error } = createQuizValidationSchema.safeParse(fields);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user