mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
Only validating custom parameters if algorithm has been selected (#2005)
This commit is contained in:
parent
b5b3137ea1
commit
f39ddf97e3
@ -47,14 +47,17 @@ const validationMetadata = {
|
||||
.required('Required')
|
||||
.isTrue('Please agree to the Terms and Conditions.'),
|
||||
usesConsumerParameters: Yup.boolean(),
|
||||
consumerParameters: Yup.array().when('usesConsumerParameters', {
|
||||
is: true,
|
||||
then: Yup.array()
|
||||
.of(Yup.object().shape(validationConsumerParameters))
|
||||
.required('Required'),
|
||||
otherwise: Yup.array()
|
||||
.nullable()
|
||||
.transform((value) => value || null)
|
||||
consumerParameters: Yup.array().when('type', {
|
||||
is: 'algorithm',
|
||||
then: Yup.array().when('usesConsumerParameters', {
|
||||
is: true,
|
||||
then: Yup.array()
|
||||
.of(Yup.object().shape(validationConsumerParameters))
|
||||
.required('Required'),
|
||||
otherwise: Yup.array()
|
||||
.nullable()
|
||||
.transform((value) => value || null)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user