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,7 +47,9 @@ const validationMetadata = {
|
|||||||
.required('Required')
|
.required('Required')
|
||||||
.isTrue('Please agree to the Terms and Conditions.'),
|
.isTrue('Please agree to the Terms and Conditions.'),
|
||||||
usesConsumerParameters: Yup.boolean(),
|
usesConsumerParameters: Yup.boolean(),
|
||||||
consumerParameters: Yup.array().when('usesConsumerParameters', {
|
consumerParameters: Yup.array().when('type', {
|
||||||
|
is: 'algorithm',
|
||||||
|
then: Yup.array().when('usesConsumerParameters', {
|
||||||
is: true,
|
is: true,
|
||||||
then: Yup.array()
|
then: Yup.array()
|
||||||
.of(Yup.object().shape(validationConsumerParameters))
|
.of(Yup.object().shape(validationConsumerParameters))
|
||||||
@ -56,6 +58,7 @@ const validationMetadata = {
|
|||||||
.nullable()
|
.nullable()
|
||||||
.transform((value) => value || null)
|
.transform((value) => value || null)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const validationService = {
|
const validationService = {
|
||||||
|
Loading…
Reference in New Issue
Block a user