1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

category error fix

This commit is contained in:
Jernej Pregelj 2019-03-26 17:42:24 +01:00
parent e6a3fe6ec1
commit 1ce9d3ef72
2 changed files with 6 additions and 11 deletions

View File

@ -89,11 +89,6 @@ export default class Step extends PureComponent<StepProps, {}> {
{fields && {fields &&
Object.entries(fields).map(([key, value]) => { Object.entries(fields).map(([key, value]) => {
let onChange = inputChange
if (key === 'categories') {
onChange = inputToArrayChange
}
if (key === 'files') { if (key === 'files') {
return ( return (
@ -106,7 +101,7 @@ export default class Step extends PureComponent<StepProps, {}> {
name={key} name={key}
help={value.help} help={value.help}
files={state.files} files={state.files}
onChange={onChange} onChange={inputChange}
/> />
</Row> </Row>
) )
@ -122,7 +117,7 @@ export default class Step extends PureComponent<StepProps, {}> {
type={value.type} type={value.type}
help={value.help} help={value.help}
options={value.options} options={value.options}
onChange={onChange} onChange={inputChange}
rows={value.rows} rows={value.rows}
value={(state as any)[key]} value={(state as any)[key]}
/> />

View File

@ -21,7 +21,7 @@ interface PublishState {
type?: AssetType type?: AssetType
license?: string license?: string
copyrightHolder?: string copyrightHolder?: string
categories?: string[] categories?: string
tags?: string[] tags?: string[]
isPublishing?: boolean isPublishing?: boolean
isPublished?: boolean isPublished?: boolean
@ -43,7 +43,7 @@ class Publish extends Component<{}, PublishState> {
type: 'dataset' as AssetType, type: 'dataset' as AssetType,
license: '', license: '',
copyrightHolder: '', copyrightHolder: '',
categories: [], categories: '',
isPublishing: false, isPublishing: false,
isPublished: false, isPublished: false,
publishedDid: '', publishedDid: '',
@ -110,7 +110,7 @@ class Publish extends Component<{}, PublishState> {
type: 'dataset' as AssetType, type: 'dataset' as AssetType,
license: '', license: '',
copyrightHolder: '', copyrightHolder: '',
categories: [], categories: '',
isPublishing: false, isPublishing: false,
isPublished: false, isPublished: false,
currentStep: 1 currentStep: 1
@ -257,7 +257,7 @@ class Publish extends Component<{}, PublishState> {
files: this.state.files, files: this.state.files,
price: this.state.price, price: this.state.price,
type: this.state.type, type: this.state.type,
categories: this.state.categories, categories: [this.state.categories],
size: '', size: '',
encoding: '', encoding: '',
compression: undefined, compression: undefined,