FIX: regression lead to a 404 when trying to filter user posts (#6893)

This commit is contained in:
Joffrey JAFFEUX 2019-01-17 11:31:23 +01:00 committed by GitHub
parent 234e0f35c5
commit 740d047365
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 8 deletions

View File

@ -20,17 +20,21 @@ export default Discourse.Model.extend({
"/posts/%@/%@?offset=%@"
),
filterBy(filter) {
if (this.get("loaded") && this.get("filter") === filter) {
filterBy(opts) {
if (this.get("loaded") && this.get("filter") === opts.filter) {
return Ember.RSVP.resolve();
}
this.setProperties({
filter: filter,
itemsLoaded: 0,
canLoadMore: true,
content: []
});
this.setProperties(
Object.assign(
{
itemsLoaded: 0,
content: [],
lastLoadedUrl: null
},
opts
)
);
return this.findItems();
},