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

remove found attribute from all File objects before publishing

This commit is contained in:
Matthias Kretschmann 2019-06-03 12:41:05 +02:00
parent 0c10eb5665
commit 4150e56ba3
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -270,12 +270,12 @@ export default class Publish extends Component<{}, PublishState> {
const { ocean } = this.context
const account = await ocean.accounts.list()
// remove `found` attribute from all objects
// and use new array for hidden input
// eslint-disable-next-line @typescript-eslint/no-unused-vars
// const filesStandard = this.state.files.map(
// ({ found, ...keepAttrs }) => keepAttrs // eslint-disable-line
// )
// remove `found` attribute from all File objects
// in a new array
const files = this.state.files.map(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
({ found, ...keepAttrs }: { found: boolean }) => keepAttrs
)
const newAsset = {
// OEP-08 Attributes
@ -287,15 +287,15 @@ export default class Publish extends Component<{}, PublishState> {
author: this.state.author,
license: this.state.license,
copyrightHolder: this.state.copyrightHolder,
files: this.state.files,
files,
price: this.state.price,
type: this.state.type,
categories: [this.state.categories]
}),
curation: Object.assign(AssetModel.curation),
additionalInformation: Object.assign(
AssetModel.additionalInformation
)
})
// curation: Object.assign(AssetModel.curation),
// additionalInformation: Object.assign(
// AssetModel.additionalInformation
// )
}
try {