2023-03-15 09:17:51 -04:00
|
|
|
import { action } from "@ember/object";
|
2015-11-20 20:27:06 -05:00
|
|
|
import AdminUser from "admin/models/admin-user";
|
2019-10-22 09:46:10 -04:00
|
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
2015-07-24 12:33:53 -04:00
|
|
|
import { exportEntity } from "discourse/lib/export-csv";
|
2014-12-22 11:17:04 -05:00
|
|
|
import { outputExportResult } from "discourse/lib/export-result";
|
2014-12-12 10:49:57 -05:00
|
|
|
|
2023-03-15 09:17:51 -04:00
|
|
|
export default class AdminUsersListRoute extends DiscourseRoute {
|
|
|
|
@action
|
|
|
|
exportUsers() {
|
|
|
|
exportEntity("user_list", {
|
|
|
|
trust_level: this.controllerFor("admin-users-list-show").get("query"),
|
|
|
|
}).then(outputExportResult);
|
|
|
|
}
|
2014-12-03 10:03:42 -05:00
|
|
|
|
2023-03-15 09:17:51 -04:00
|
|
|
@action
|
|
|
|
sendInvites() {
|
|
|
|
this.transitionTo("userInvited", this.currentUser);
|
|
|
|
}
|
2015-02-17 03:03:43 -05:00
|
|
|
|
2023-03-15 09:17:51 -04:00
|
|
|
@action
|
|
|
|
deleteUser(user) {
|
|
|
|
AdminUser.create(user).destroy({ deletePosts: true });
|
|
|
|
}
|
|
|
|
}
|