chore(validation): improve validate example

This commit is contained in:
Thomas Rutten 2020-02-11 09:50:49 +01:00 committed by Thomas Allmer
parent bc7c3f9216
commit 7f25a04fc8
2 changed files with 6 additions and 6 deletions

View file

@ -48,11 +48,11 @@ class IsInitialsExample extends Validator {
} }
execute(value) { execute(value) {
let hasError = false; let hasFeedback = false;
if (!IsString || !isInitialsRegex.test(value.toLowerCase())) { if (!IsString || !isInitialsRegex.test(value.toLowerCase())) {
hasError = true; hasFeedback = true;
} }
return hasError; return hasFeedback;
} }
static getMessage({ fieldName }) { static getMessage({ fieldName }) {

View file

@ -52,11 +52,11 @@ class MyValidator extends Validator {
} }
execute(modelValue, param) { execute(modelValue, param) {
const hasError = false; const hasFeedback = false;
if (modelValue === param) { if (modelValue === param) {
hasError = true; hasFeedback = true;
} }
return hasError; return hasFeedback;
} }
static getMessage({ fieldName }) { static getMessage({ fieldName }) {