- Update based on review
This commit is contained in:
1 parent
82d44b2b1b
commit
8ec2f2f16b
2 files changed
+3
-3
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
const buildErrors = (prev, id, error) => {
|
const buildErrors = (prev, id, error) => {
|
||||||
const updatedErrors = { ...prev };
|
const updatedErrors = { ...prev };
|
||||||
if (error) {
|
if (error) {
|
||||||
updatedErrors[id] = error.details[0].message;
|
updatedErrors[id] = error.details[0].message?? "Validation error";
|
||||||
} else {
|
} else {
|
||||||
delete updatedErrors[id];
|
delete updatedErrors[id];
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@ const hasValidationErrors = (form, validation, setErrors) => {
|
|||||||
if (error) {
|
if (error) {
|
||||||
const newErrors = {};
|
const newErrors = {};
|
||||||
error.details.forEach((err) => {
|
error.details.forEach((err) => {
|
||||||
newErrors[err.path[0]] = err.message;
|
newErrors[err.path[0]] = err.message?? "Validation error";
|
||||||
});
|
});
|
||||||
setErrors(newErrors);
|
setErrors(newErrors);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ const advancedSettingsValidation = joi.object({
|
|||||||
"string.empty": "API base url is required.",
|
"string.empty": "API base url is required.",
|
||||||
"string.uri": "The URL you provided is not valid.",
|
"string.uri": "The URL you provided is not valid.",
|
||||||
}),
|
}),
|
||||||
logLevel: joi.string(),
|
logLevel: joi.string().valid("debug", "none", "error", "warn").allow(""),
|
||||||
systemEmailHost: joi.string().allow(''),
|
systemEmailHost: joi.string().allow(''),
|
||||||
systemEmailPort: joi.string().allow(''),
|
systemEmailPort: joi.string().allow(''),
|
||||||
systemEmailAddress: joi
|
systemEmailAddress: joi
|
||||||
|
|||||||
Reference in new issue
Block a user