0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-09 11:52:54 +01:00

initialize auth params and endpoints in the route & model

Dieser Commit ist enthalten in:
Angus McLeod 2019-06-01 12:25:09 +10:00
Ursprung 65979e1987
Commit 6345083c4d
3 geänderte Dateien mit 3 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -11,9 +11,6 @@ export default Ember.Controller.extend({
actions: {
addParam() {
if (this.get('api.authParams') == undefined) {
this.set('api.authParams',[]);
};
this.get('api.authParams').pushObject({});
},
@ -22,9 +19,6 @@ export default Ember.Controller.extend({
},
addEndpoint() {
if (this.get('api.endpoints') == undefined) {
this.set('api.endpoints',[]);
};
this.get('api.endpoints').pushObject({});
},

Datei anzeigen

@ -10,9 +10,9 @@ const CustomWizardApi = Discourse.Model.extend({
});
CustomWizardApi.reopenClass({
create(params) {
create(params = {}) {
const api = this._super.apply(this);
const authorization = params.authorization;
const authorization = params.authorization || {};
const endpoints = params.endpoints;
api.setProperties({

Datei anzeigen

@ -3,7 +3,7 @@ import CustomWizardApi from '../models/custom-wizard-api';
export default Discourse.Route.extend({
model(params) {
if (params.service === 'new') {
return {};
return CustomWizardApi.create();
} else {
return CustomWizardApi.find(params.service);
}