diff --git a/app/assets/javascripts/discourse/app/controllers/user-topics-list.js b/app/assets/javascripts/discourse/app/controllers/user-topics-list.js index bdd68aa1a33..aad608c662f 100644 --- a/app/assets/javascripts/discourse/app/controllers/user-topics-list.js +++ b/app/assets/javascripts/discourse/app/controllers/user-topics-list.js @@ -10,13 +10,9 @@ import { NEW_FILTER, UNREAD_FILTER, } from "discourse/routes/build-private-messages-route"; +import { QUERY_PARAMS } from "discourse/routes/user-topic-list"; import discourseComputed from "discourse-common/utils/decorators"; -export const queryParams = { - ascending: { replace: true, refreshModel: true, default: false }, - order: { replace: true, refreshModel: true }, -}; - // Lists of topics on a user's page. export default class UserTopicsListController extends Controller { @tracked model; @@ -25,7 +21,7 @@ export default class UserTopicsListController extends Controller { showPosters = false; channel = null; tagsForUser = null; - queryParams = Object.keys(queryParams); + queryParams = Object.keys(QUERY_PARAMS); bulkSelectHelper = new BulkSelectHelper(this); @@ -36,7 +32,8 @@ export default class UserTopicsListController extends Controller { constructor() { super(...arguments); - for (const [name, info] of Object.entries(queryParams)) { + + for (const [name, info] of Object.entries(QUERY_PARAMS)) { defineTrackedProperty(this, name, info.default); } } diff --git a/app/assets/javascripts/discourse/app/routes/user-topic-list.js b/app/assets/javascripts/discourse/app/routes/user-topic-list.js index 60a210cb56a..41bb939df35 100644 --- a/app/assets/javascripts/discourse/app/routes/user-topic-list.js +++ b/app/assets/javascripts/discourse/app/routes/user-topic-list.js @@ -1,14 +1,18 @@ -import { queryParams } from "discourse/controllers/user-topics-list"; import { setTopicList } from "discourse/lib/topic-list-tracker"; import ViewingActionType from "discourse/mixins/viewing-action-type"; import DiscourseRoute from "discourse/routes/discourse"; +export const QUERY_PARAMS = { + ascending: { replace: true, refreshModel: true, default: false }, + order: { replace: true, refreshModel: true }, +}; + export default class UserTopicsListRoute extends DiscourseRoute.extend( ViewingActionType ) { templateName = "user-topics-list"; controllerName = "user-topics-list"; - queryParams = queryParams; + queryParams = QUERY_PARAMS; setupController(controller, model) { setTopicList(model);