From a823bd9372167532602dca84cdd738277bcd0083 Mon Sep 17 00:00:00 2001 From: Shemy Gan Date: Fri, 25 Oct 2024 14:27:11 -0400 Subject: [PATCH] - change joi to be optional number for redis port and email port --- Client/src/Validation/validation.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Client/src/Validation/validation.js b/Client/src/Validation/validation.js index 71495cfa1..08b1632c3 100644 --- a/Client/src/Validation/validation.js +++ b/Client/src/Validation/validation.js @@ -135,7 +135,7 @@ const advancedSettingsValidation = joi.object({ }), logLevel: joi.string().valid("debug", "none", "error", "warn").allow(""), systemEmailHost: joi.string().allow(""), - systemEmailPort: joi.string().allow(""), + systemEmailPort: joi.number().allow(null, ""), systemEmailAddress: joi.string().allow(""), systemEmailPassword: joi.string().allow(""), jwtTTLNum: joi.number().messages({ @@ -156,15 +156,7 @@ const advancedSettingsValidation = joi.object({ redisHost: joi.string().trim().messages({ "string.empty": "Redis host is required.", }), - redisPort: joi - .string() - .allow("") - .custom((value, helpers) => { - if (value && Number.isNaN(parseInt(value))) { - return helpers.message("Redis port must be a number."); - } - return value; - }), + redisPort: joi.number().allow(null, ""), pagespeedApiKey: joi.string().allow(""), });