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

sort all search queries by "created"

This commit is contained in:
Matthias Kretschmann 2019-05-27 17:53:48 +02:00
parent 80b77461d3
commit 48d9b26cb6
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 5 additions and 6 deletions

View File

@ -41,21 +41,20 @@ export default class ChannelTeaser extends Component<
const { ocean } = this.context
const searchQuery = {
offset: 4,
offset: 2,
page: 1,
query: {
tags: [this.channel.tag]
},
sort: {
datePublished: 1
created: -1
}
}
try {
const search = await ocean.aquarius.queryMetadata(searchQuery)
this.setState({
// TODO: remove hacky way of getting the latest 2 assets
channelAssets: search.results.splice(2, 2, ''),
channelAssets: search.results,
isLoadingChannel: false
})
} catch (error) {

View File

@ -63,7 +63,7 @@ export default class Channel extends PureComponent<ChannelProps, ChannelState> {
tags: [this.channel.tag]
},
sort: {
datePublished: 1
created: -1
}
}

View File

@ -82,7 +82,7 @@ export default class Search extends PureComponent<SearchProps, SearchState> {
...queryValues
},
sort: {
datePublished: 1
created: -1
}
}