xfgsgs
This commit is contained in:
@@ -109,10 +109,10 @@ const userProductSchema = Joi.object({
|
||||
Joi.allow(null)
|
||||
).optional()
|
||||
}).when('equipmentId', {
|
||||
is: Joi.exist(),
|
||||
then: Joi.object(), // When equipmentId exists, spreaderBrand is optional
|
||||
is: Joi.number().positive(),
|
||||
then: Joi.object(), // When equipmentId is a positive number, spreaderBrand is optional
|
||||
otherwise: Joi.object({
|
||||
spreaderBrand: Joi.string().max(100).required() // When no equipmentId, require spreaderBrand
|
||||
spreaderBrand: Joi.string().max(100).required() // When no valid equipmentId, require spreaderBrand
|
||||
})
|
||||
})
|
||||
).optional()
|
||||
|
||||
Reference in New Issue
Block a user