FIX: 'status' param change not filtering the topics in tag route.

Use existing 'filterQueryParams' helper method to set 'queryParams' value for tag route.
This commit is contained in:
Vinoth Kannan 2019-06-20 17:27:32 +05:30
parent cd6a130cd0
commit 56b7777705
1 changed files with 7 additions and 9 deletions
app/assets/javascripts/discourse/routes

View File

@ -1,15 +1,16 @@
import Composer from "discourse/models/composer";
import showModal from "discourse/lib/show-modal";
import { findTopicList } from "discourse/routes/build-topic-route";
import {
filterQueryParams,
findTopicList
} from "discourse/routes/build-topic-route";
import { queryParams } from "discourse/controllers/discovery-sortable";
import PermissionType from "discourse/models/permission-type";
export default Discourse.Route.extend({
navMode: "latest",
queryParams: {
ascending: { refreshModel: true },
order: { refreshModel: true }
},
queryParams,
renderTemplate() {
const controller = this.controllerFor("tags.show");
@ -69,10 +70,7 @@ export default Discourse.Route.extend({
const controller = this.controllerFor("tags.show");
controller.set("loading", true);
const params = controller.getProperties("order", "ascending");
params.order = transition.to.queryParams.order || params.order;
params.ascending = transition.to.queryParams.ascending || params.ascending;
const params = filterQueryParams(transition.to.queryParams, {});
const categorySlug = this.categorySlug;
const parentCategorySlug = this.parentCategorySlug;
const filter = this.navMode;