mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-04 12:51:41 -05:00
21 lines
786 B
JavaScript
21 lines
786 B
JavaScript
// Just add query params here to have them automatically passed to topic list filters.
|
|
export var queryParams = {
|
|
order: { replace: true, refreshModel: true },
|
|
ascending: { replace: true, refreshModel: true },
|
|
status: { replace: true, refreshModel: true },
|
|
state: { replace: true, refreshModel: true },
|
|
search: { replace: true, refreshModel: true },
|
|
max_posts: { replace: true, refreshModel: true },
|
|
q: { replace: true, refreshModel: true }
|
|
};
|
|
|
|
// Basic controller options
|
|
var controllerOpts = {
|
|
needs: ['discovery/topics'],
|
|
queryParams: Object.keys(queryParams),
|
|
};
|
|
|
|
// Aliases for the values
|
|
controllerOpts.queryParams.forEach(p => controllerOpts[p] = Em.computed.alias(`controllers.discovery/topics.${p}`));
|
|
|
|
export default Ember.Controller.extend(controllerOpts);
|