- Update based on review

This commit is contained in:
Shemy Gan
2024-10-21 10:02:36 -04:00
parent 82d44b2b1b
commit 8ec2f2f16b
2 changed files with 3 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
const buildErrors = (prev, id, error) => {
const updatedErrors = { ...prev };
if (error) {
updatedErrors[id] = error.details[0].message;
updatedErrors[id] = error.details[0].message?? "Validation error";
} else {
delete updatedErrors[id];
}
@@ -15,7 +15,7 @@ const hasValidationErrors = (form, validation, setErrors) => {
if (error) {
const newErrors = {};
error.details.forEach((err) => {
newErrors[err.path[0]] = err.message;
newErrors[err.path[0]] = err.message?? "Validation error";
});
setErrors(newErrors);
return true;

View File

@@ -133,7 +133,7 @@ const advancedSettingsValidation = joi.object({
"string.empty": "API base url is required.",
"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(''),
systemEmailPort: joi.string().allow(''),
systemEmailAddress: joi