@morozeckiy/dd-lib 0.7.96 → 0.7.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -401,11 +401,18 @@ class ValidatorsService {
|
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
static getErrorText(error) {
|
|
404
|
-
const presetErrors = ['minlength', 'maxlength', 'email', 'required', 'pattern'];
|
|
404
|
+
const presetErrors = ['minlength', 'maxlength', 'email', 'required', 'pattern', 'min', 'max'];
|
|
405
405
|
if (error) {
|
|
406
|
+
console.log(error);
|
|
406
407
|
const key = Object.keys(error)?.[0];
|
|
407
408
|
if (key && presetErrors.includes(key)) {
|
|
408
409
|
switch (key) {
|
|
410
|
+
case 'min': {
|
|
411
|
+
return `Не должно быть меньше ${error['min'].min}`;
|
|
412
|
+
}
|
|
413
|
+
case 'max': {
|
|
414
|
+
return `Не должно быть больше ${error['max'].max}`;
|
|
415
|
+
}
|
|
409
416
|
case 'minlength': {
|
|
410
417
|
return `Не менее ${error['minlength'].requiredLength} символов`;
|
|
411
418
|
}
|