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

18 lines
377 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
});
});
}
});