- update number validation

This commit is contained in:
Shemy Gan committed 2024-10-24 14:13:07 -04:00
1 parent 5c45d934a6
commit fd261d3eb1
1 file changed
+4 -6
+4 -6
View File
@@ -138,20 +138,18 @@ const advancedSettingsValidation = joi.object({
systemEmailPort: joi.string().allow(""), systemEmailPort: joi.string().allow(""),
systemEmailAddress: joi.string().allow(""), systemEmailAddress: joi.string().allow(""),
systemEmailPassword: joi.string().allow(""), systemEmailPassword: joi.string().allow(""),
jwtTTLNum: joi jwtTTLNum: joi.number().messages({
.number() "number.base": "JWT TTL is required.",
.messages({
"any.required": "JWT TTL is required.",
}), }),
jwtTTLUnits: joi jwtTTLUnits: joi
.string() .string()
.trim() .trim()
.custom((value, helpers) => { .custom((value, helpers) => {
if( !["days", "hours"].includes(value)) { if (!["days", "hours"].includes(value)) {
return helpers.message("JWT TTL unit is required."); return helpers.message("JWT TTL unit is required.");
} }
return value; return value;
}), }),
dbType: joi.string().trim().messages({ dbType: joi.string().trim().messages({
"string.empty": "DB type is required.", "string.empty": "DB type is required.",
}), }),