mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-19 08:09:45 -06:00
- Update based on review
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user