discourse/app/assets/javascripts/admin/routes/admin-users-list.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
641 B
JavaScript
Raw Normal View History

import DiscourseRoute from "discourse/routes/discourse";
import { exportEntity } from "discourse/lib/export-csv";
2014-12-22 11:17:04 -05:00
import { outputExportResult } from "discourse/lib/export-result";
import AdminUser from "admin/models/admin-user";
2014-12-12 10:49:57 -05:00
export default DiscourseRoute.extend({
actions: {
exportUsers() {
exportEntity("user_list", {
trust_level: this.controllerFor("admin-users-list-show").get("query")
}).then(outputExportResult);
},
sendInvites() {
this.transitionTo("userInvited", this.currentUser);
},
deleteUser(user) {
AdminUser.create(user).destroy({ deletePosts: true });
}
}
});