discourse/app/assets/javascripts/admin/routes/admin-flags-list.js.es6

28 lines
742 B
Plaintext
Raw Normal View History

import showModal from 'discourse/lib/show-modal';
import FlaggedPost from 'admin/models/flagged-post';
export default Discourse.Route.extend({
model(params) {
this.filter = params.filter;
return FlaggedPost.findAll(params.filter);
},
setupController(controller, model) {
controller.set('model', model);
controller.set('query', this.filter);
},
actions: {
showAgreeFlagModal(model) {
2016-11-15 17:09:55 -05:00
showModal('admin-agree-flag', { model, admin: true });
this.controllerFor('modal').set('modalClass', 'agree-flag-modal');
},
showDeleteFlagModal(model) {
2016-11-15 17:09:55 -05:00
showModal('admin-delete-flag', { model, admin: true });
this.controllerFor('modal').set('modalClass', 'delete-flag-modal');
}
}
});