DEV: Upgrade admin-plugins-explorer to Octane (#219)

This commit is contained in:
Isaac Janzen 2023-02-06 10:21:58 -06:00 committed by GitHub
parent f51bc050a2
commit 5a65c15463
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 8 deletions

View File

@ -1,12 +1,9 @@
import { ajax } from "discourse/lib/ajax";
import User from "discourse/models/user";
import DiscourseRoute from "discourse/routes/discourse";
export default DiscourseRoute.extend({
controllerName: "admin-plugins-explorer",
export default class AdminPluginsExplorer extends DiscourseRoute {
model() {
if (!User.currentProp("admin")) {
if (!this.currentUser.admin) {
// display "Only available to admins" message
return { model: null, schema: null, disallow: true, groups: null };
}
@ -34,9 +31,9 @@ export default DiscourseRoute.extend({
});
});
});
},
}
setupController(controller, model) {
controller.setProperties(model);
},
});
}
}