asdf
This commit is contained in:
@@ -17,14 +17,7 @@ const spreaderSettingSchema = Joi.object({
|
|||||||
settingValue: Joi.string().max(20).required(),
|
settingValue: Joi.string().max(20).required(),
|
||||||
rateDescription: Joi.string().max(200).allow(null, '').optional(),
|
rateDescription: Joi.string().max(200).allow(null, '').optional(),
|
||||||
notes: Joi.string().allow(null, '').optional()
|
notes: Joi.string().allow(null, '').optional()
|
||||||
}).xor('productId', 'userProductId')
|
}).xor('productId', 'userProductId'); // Must have either productId or userProductId, but not both
|
||||||
.when('equipmentId', {
|
|
||||||
is: Joi.exist(),
|
|
||||||
then: Joi.object(), // When equipmentId exists, spreaderBrand is optional
|
|
||||||
otherwise: Joi.object({
|
|
||||||
spreaderBrand: Joi.string().max(100).required() // When no equipmentId, require spreaderBrand
|
|
||||||
})
|
|
||||||
}); // Must have either productId or userProductId, but not both
|
|
||||||
|
|
||||||
const idParamSchema = Joi.object({
|
const idParamSchema = Joi.object({
|
||||||
id: Joi.number().integer().positive().required()
|
id: Joi.number().integer().positive().required()
|
||||||
|
|||||||
Reference in New Issue
Block a user