2017-07-05 16:47:01 -04:00
|
|
|
import Report from 'admin/models/report';
|
2013-06-03 16:12:24 -04:00
|
|
|
|
2015-11-20 20:27:06 -05:00
|
|
|
export default Discourse.Route.extend({
|
2017-04-13 05:10:55 -04:00
|
|
|
queryParams: { mode: {}, "start_date": {}, "end_date": {}, "category_id": {}, "group_id": {} },
|
2016-04-14 01:46:01 -04:00
|
|
|
|
2017-07-05 16:47:01 -04:00
|
|
|
model(params) {
|
2017-04-13 05:10:55 -04:00
|
|
|
return Report.find(params.type, params['start_date'], params['end_date'], params['category_id'], params['group_id']);
|
2014-11-05 14:46:27 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
setupController: function(controller, model) {
|
|
|
|
controller.setProperties({
|
|
|
|
model: model,
|
2016-04-14 01:46:01 -04:00
|
|
|
categoryId: (model.get('category_id') || 'all'),
|
|
|
|
groupId: model.get('group_id'),
|
2018-04-08 07:19:41 -04:00
|
|
|
startDate: moment(model.get('start_date')).utc().format('YYYY-MM-DD'),
|
|
|
|
endDate: moment(model.get('end_date')).utc().format('YYYY-MM-DD')
|
2014-11-05 14:46:27 -05:00
|
|
|
});
|
2013-02-27 22:39:42 -05:00
|
|
|
}
|
2014-06-10 11:54:38 -04:00
|
|
|
});
|