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:
parent
80b77461d3
commit
48d9b26cb6
@ -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) {
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ export default class Search extends PureComponent<SearchProps, SearchState> {
|
|||||||
...queryValues
|
...queryValues
|
||||||
},
|
},
|
||||||
sort: {
|
sort: {
|
||||||
datePublished: 1
|
created: -1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user