add: validate is_active
This commit is contained in:
@@ -11,7 +11,8 @@ const insertSubSectionSchema = Joi.object({
|
||||
"string.base": "Sub section name must be a string",
|
||||
"string.max": "Sub section name cannot exceed 200 characters",
|
||||
"any.required": "Sub section name is required"
|
||||
}),
|
||||
}).required(),
|
||||
is_active: Joi.boolean().required(),
|
||||
});
|
||||
|
||||
const updateSubSectionSchema = Joi.object({
|
||||
@@ -20,7 +21,8 @@ const updateSubSectionSchema = Joi.object({
|
||||
.messages({
|
||||
"string.base": "Sub section name must be a string",
|
||||
"string.max": "Sub section name cannot exceed 200 characters",
|
||||
}),
|
||||
}).optional(),
|
||||
is_active: Joi.boolean().optional(),
|
||||
}).min(1).messages({
|
||||
"object.min": "At least one field must be provided to update",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user