Skip to content

Commit

Permalink
adding user form validation schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Ramadan1 committed Apr 29, 2024
1 parent 6e17fd0 commit d3d50b1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/schema/updateUserDataSchema.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as yup from "yup";

export const updateUserInfo = yup.object().shape({
name: yup.string().required("Name is required"),
email: yup.string().email().required("Email is required"),
password: yup.string().required("Password is required"),
passwordConfirm: yup
.string()
.required("Confirm password is required")
.oneOf([yup.ref("password"), null], "Passwords must match"),
});

0 comments on commit d3d50b1

Please sign in to comment.