Untitled

 avatar
unknown
plain_text
10 months ago
702 B
11
Indexable
const updateHomeOptionalCoversSchema = Joi.object({
    coverIncluded: Joi.boolean().required(),
    coverMappingCode: Joi.string().min(3).max(11).required(),
    staffDetails: Joi.array().items(staffDetailSchema).when(
        Joi.object({
            coverMappingCode: Joi.ref('coverMappingCode'),
            coverIncluded: Joi.ref('coverIncluded')
        }).unknown(), 
        {
            is: Joi.object({
                coverMappingCode: Joi.string().valid('3-0-0').required(),
                coverIncluded: Joi.boolean().valid(true).required()
            }).unknown(),
            then: Joi.array().min(1).required(),
            otherwise: Joi.optional()
        }
    )
}).unknown(true);
Editor is loading...
Leave a Comment