-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import * as yup from 'yup' | ||
|
||
const register = yup | ||
.object() | ||
.shape({ | ||
fullName: yup.string().required('fullname is required'), | ||
email: yup.string().email('invalid email').required('email is required'), | ||
phone: yup.string().required('phone is required'), | ||
active: yup.boolean().nullable(), | ||
tokenVerify: yup.string().nullable(), | ||
newPassword: yup | ||
.string() | ||
.min(8, 'at least 8 characters') | ||
.oneOf([yup.ref('confirmNewPassword')], 'passwords are not the same'), | ||
confirmNewPassword: yup | ||
.string() | ||
.min(8, 'at least 8 characters') | ||
.oneOf([yup.ref('newPassword')], 'passwords are not the same'), | ||
}) | ||
.required() | ||
|
||
const login = yup | ||
.object() | ||
.shape({ | ||
email: yup.string().required('email is required'), | ||
password: yup.string().required('password is required'), | ||
}) | ||
.required() | ||
|
||
export default { register, login } |