14 lines
344 B
TypeScript
14 lines
344 B
TypeScript
import * as Yup from "yup";
|
|
|
|
export const getInitialValues = (objectToEdit: any): any => {
|
|
return {
|
|
id: objectToEdit?.id ?? null,
|
|
phone_number: objectToEdit?.phone_number ?? null,
|
|
};
|
|
};
|
|
export const getValidationSchema = () => {
|
|
return Yup.object().shape({
|
|
phone_number: Yup.number().required("validation.required"),
|
|
});
|
|
};
|