add: validate is_active
This commit is contained in:
@@ -8,12 +8,14 @@ const insertRolesSchema = Joi.object({
|
||||
role_name: Joi.string().max(100).required(),
|
||||
role_level: Joi.number().required(),
|
||||
role_description: Joi.string().max(100).required(),
|
||||
is_active: Joi.boolean().required(),
|
||||
});
|
||||
|
||||
const updateRolesSchema = Joi.object({
|
||||
role_name: Joi.string().max(100),
|
||||
role_level: Joi.number(),
|
||||
role_description: Joi.string().max(100),
|
||||
role_name: Joi.string().max(100).optional(),
|
||||
role_level: Joi.number().optional(),
|
||||
role_description: Joi.string().max(100).optional(),
|
||||
is_active: Joi.boolean().optional()
|
||||
}).min(1);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user