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

View File

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