- change joi to be optional number for redis port and email port
This commit is contained in:
1 parent
2427bdb788
commit
a823bd9372
1 file changed
+2
-10
@@ -135,7 +135,7 @@ const advancedSettingsValidation = joi.object({
|
|||||||
}),
|
}),
|
||||||
logLevel: joi.string().valid("debug", "none", "error", "warn").allow(""),
|
logLevel: joi.string().valid("debug", "none", "error", "warn").allow(""),
|
||||||
systemEmailHost: joi.string().allow(""),
|
systemEmailHost: joi.string().allow(""),
|
||||||
systemEmailPort: joi.string().allow(""),
|
systemEmailPort: joi.number().allow(null, ""),
|
||||||
systemEmailAddress: joi.string().allow(""),
|
systemEmailAddress: joi.string().allow(""),
|
||||||
systemEmailPassword: joi.string().allow(""),
|
systemEmailPassword: joi.string().allow(""),
|
||||||
jwtTTLNum: joi.number().messages({
|
jwtTTLNum: joi.number().messages({
|
||||||
@@ -156,15 +156,7 @@ const advancedSettingsValidation = joi.object({
|
|||||||
redisHost: joi.string().trim().messages({
|
redisHost: joi.string().trim().messages({
|
||||||
"string.empty": "Redis host is required.",
|
"string.empty": "Redis host is required.",
|
||||||
}),
|
}),
|
||||||
redisPort: joi
|
redisPort: joi.number().allow(null, ""),
|
||||||
.string()
|
|
||||||
.allow("")
|
|
||||||
.custom((value, helpers) => {
|
|
||||||
if (value && Number.isNaN(parseInt(value))) {
|
|
||||||
return helpers.message("Redis port must be a number.");
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}),
|
|
||||||
pagespeedApiKey: joi.string().allow(""),
|
pagespeedApiKey: joi.string().allow(""),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user