first commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { ref, string } from 'yup'
|
||||
|
||||
export const passwordConfirmationRule = string()
|
||||
.required()
|
||||
.oneOf([ref('password')], 'تکرار رمزعبور با رمزعبور یکسان نیست')
|
||||
|
||||
export const optionalPasswordConfirmationRule = string()
|
||||
.nullable()
|
||||
.notRequired()
|
||||
.test('match', 'تکرار رمزعبور با رمزعبور یکسان نیست', function (value) {
|
||||
const pw = this.parent.password
|
||||
if (!pw && !value) return true
|
||||
return value === pw
|
||||
})
|
||||
Reference in New Issue
Block a user