mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-26 03:01:14 +08:00
This change does two things: Modernizes the admin badges UI implementation. (Routes + controllers → components + services.) Adds a Settings tab to the new badges page. For all intents and purposes, this change is a lift-and-shift modernization. The addition of the settings tab is trivial once that is covered.
16 lines
386 B
JavaScript
Vendored
16 lines
386 B
JavaScript
Vendored
import { service } from "@ember/service";
|
|
import Route from "discourse/routes/discourse";
|
|
|
|
export default class AdminBadgesAwardRoute extends Route {
|
|
@service adminBadges;
|
|
|
|
async model(params) {
|
|
await this.adminBadges.fetchBadges();
|
|
|
|
if (params.badge_id === "new") {
|
|
return;
|
|
}
|
|
|
|
return this.adminBadges.badges.findBy("id", parseInt(params.badge_id, 10));
|
|
}
|
|
}
|