1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

change initial price type based on config (#821)

This commit is contained in:
Moritz Kirstein 2021-08-31 10:22:42 +02:00 committed by GitHub
parent 1f332c4148
commit 9b94ed9f6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
import { PriceOptionsMarket } from '../@types/MetaData' import { PriceOptionsMarket } from '../@types/MetaData'
import { allowDynamicPricing, allowFixedPricing } from '../../app.config'
import * as Yup from 'yup' import * as Yup from 'yup'
export const validationSchema: Yup.SchemaOf<PriceOptionsMarket> = export const validationSchema: Yup.SchemaOf<PriceOptionsMarket> =
@ -26,8 +27,13 @@ export const validationSchema: Yup.SchemaOf<PriceOptionsMarket> =
export const initialValues: PriceOptionsMarket = { export const initialValues: PriceOptionsMarket = {
price: 1, price: 1,
type: 'dynamic', type:
dtAmount: 9, allowDynamicPricing === 'true'
? 'dynamic'
: allowFixedPricing === 'true'
? 'fixed'
: 'free',
dtAmount: allowDynamicPricing === 'true' ? 9 : 1000,
oceanAmount: 21, oceanAmount: 21,
weightOnOcean: '7', // 70% on OCEAN weightOnOcean: '7', // 70% on OCEAN
weightOnDataToken: '3', // 30% on datatoken weightOnDataToken: '3', // 30% on datatoken