chore(validation): improve validate example
This commit is contained in:
parent
bc7c3f9216
commit
7f25a04fc8
2 changed files with 6 additions and 6 deletions
|
|
@ -48,11 +48,11 @@ class IsInitialsExample extends Validator {
|
|||
}
|
||||
|
||||
execute(value) {
|
||||
let hasError = false;
|
||||
let hasFeedback = false;
|
||||
if (!IsString || !isInitialsRegex.test(value.toLowerCase())) {
|
||||
hasError = true;
|
||||
hasFeedback = true;
|
||||
}
|
||||
return hasError;
|
||||
return hasFeedback;
|
||||
}
|
||||
|
||||
static getMessage({ fieldName }) {
|
||||
|
|
|
|||
|
|
@ -52,11 +52,11 @@ class MyValidator extends Validator {
|
|||
}
|
||||
|
||||
execute(modelValue, param) {
|
||||
const hasError = false;
|
||||
const hasFeedback = false;
|
||||
if (modelValue === param) {
|
||||
hasError = true;
|
||||
hasFeedback = true;
|
||||
}
|
||||
return hasError;
|
||||
return hasFeedback;
|
||||
}
|
||||
|
||||
static getMessage({ fieldName }) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue