fix: make the number of suspension days required only when the

'Suspend' requirement is selected
This commit is contained in:
Liordino Neto 2020-12-16 00:51:21 -03:00 committed by Josh Harvey
parent bb9da7ff80
commit b1ac484c0b

View file

@ -76,7 +76,10 @@ const threshold = Yup.object().shape({
})
const requirement = Yup.object().shape({
requirement: Yup.string().required(),
suspensionDays: Yup.number()
suspensionDays: Yup.number().when('requirement', {
is: 'suspend',
then: Yup.number().required()
})
})
const Schema = Yup.object().shape({