discourse/app/assets/javascripts/admin/addon/routes/admin-user.js
Jarek Radosz 321b14d40c
DEV: Remove unused render() calls (#19224)
`Route#render` and `Route#renderTemplate` have been deprecated and are removed in Ember 4.x (see: https://deprecations.emberjs.com/v3.x#toc_route-render-template)

The templates of modified routes in this PR are already automatically inserted into `{{outlet}}`s.
2022-11-30 16:49:23 +01:00

24 lines
552 B
JavaScript

import AdminUser from "admin/models/admin-user";
import DiscourseRoute from "discourse/routes/discourse";
import { get } from "@ember/object";
export default DiscourseRoute.extend({
serialize(model) {
return {
user_id: model.get("id"),
username: model.get("username").toLowerCase(),
};
},
model(params) {
return AdminUser.find(get(params, "user_id"));
},
afterModel(adminUser) {
return adminUser.loadDetails().then(function () {
adminUser.setOriginalTrustLevel();
return adminUser;
});
},
});