chore(tools): test for instructions in schema (#60323)

Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
Anna
2025-08-06 16:44:06 -04:00
committed by GitHub
parent 8b33e316ab
commit babcf47597

View File

@@ -209,7 +209,11 @@ const schema = Joi.object()
}),
forumTopicId: Joi.number(),
id: Joi.objectId().required(),
instructions: Joi.string().allow(''),
instructions: Joi.string().when('challengeType', {
is: [challengeTypes.pythonProject, challengeTypes.codeAllyCert],
then: Joi.string().min(1).required(),
otherwise: Joi.string().allow('')
}),
isComingSoon: Joi.bool(),
isLocked: Joi.bool(),
isPrivate: Joi.bool(),