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

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

28 lines
775 B
JavaScript
Raw Normal View History

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