Add validations for status page
This commit is contained in:
1 parent
f3a29c3be7
commit
8164ca2bfe
1 file changed
+28
@@ -410,6 +410,32 @@ const updateAppSettingsBodyValidation = joi.object({
|
|||||||
systemEmailPassword: joi.string().allow(""),
|
systemEmailPassword: joi.string().allow(""),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//****************************************
|
||||||
|
// Status Page Validation
|
||||||
|
//****************************************
|
||||||
|
|
||||||
|
const getStatusPageParamValidation = joi.object({
|
||||||
|
url: joi.string().required(),
|
||||||
|
});
|
||||||
|
|
||||||
|
const createStatusPageBodyValidation = joi.object({
|
||||||
|
companyName: joi.string().required(),
|
||||||
|
url: joi.string().required(),
|
||||||
|
timezone: joi.string().required(),
|
||||||
|
color: joi.string().required(),
|
||||||
|
theme: joi.string().required(),
|
||||||
|
monitors: joi
|
||||||
|
.array()
|
||||||
|
.items(joi.string().pattern(/^[0-9a-fA-F]{24}$/))
|
||||||
|
.required()
|
||||||
|
.messages({
|
||||||
|
"string.pattern.base": "Must be a valid monitor ID",
|
||||||
|
"array.base": "Monitors must be an array",
|
||||||
|
"array.empty": "At least one monitor is required",
|
||||||
|
"any.required": "Monitors are required",
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
export {
|
export {
|
||||||
roleValidatior,
|
roleValidatior,
|
||||||
loginValidation,
|
loginValidation,
|
||||||
@@ -465,4 +491,6 @@ export {
|
|||||||
editMaintenanceWindowByIdParamValidation,
|
editMaintenanceWindowByIdParamValidation,
|
||||||
editMaintenanceByIdWindowBodyValidation,
|
editMaintenanceByIdWindowBodyValidation,
|
||||||
updateAppSettingsBodyValidation,
|
updateAppSettingsBodyValidation,
|
||||||
|
createStatusPageBodyValidation,
|
||||||
|
getStatusPageParamValidation,
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user