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 { ocean } = this.context
const searchQuery = { const searchQuery = {
offset: 4, offset: 2,
page: 1, page: 1,
query: { query: {
tags: [this.channel.tag] tags: [this.channel.tag]
}, },
sort: { sort: {
datePublished: 1 created: -1
} }
} }
try { try {
const search = await ocean.aquarius.queryMetadata(searchQuery) const search = await ocean.aquarius.queryMetadata(searchQuery)
this.setState({ this.setState({
// TODO: remove hacky way of getting the latest 2 assets channelAssets: search.results,
channelAssets: search.results.splice(2, 2, ''),
isLoadingChannel: false isLoadingChannel: false
}) })
} catch (error) { } catch (error) {

View File

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

View File

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