discourse/app/assets/javascripts/admin/addon/routes/admin-api-keys-new.js

18 lines
381 B
JavaScript

import Route from "@ember/routing/route";
import { ajax } from "discourse/lib/ajax";
export default Route.extend({
model() {
return this.store.createRecord("api-key");
},
setupController(controller, model) {
ajax("/admin/api/keys/scopes.json").then((data) => {
controller.setProperties({
scopes: data.scopes,
model,
});
});
},
});