diff --git a/assets/javascripts/discourse/controllers/admin-wizards-api.js.es6 b/assets/javascripts/discourse/controllers/admin-wizards-api.js.es6 index 3787c60e..ec4b5170 100644 --- a/assets/javascripts/discourse/controllers/admin-wizards-api.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-wizards-api.js.es6 @@ -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({}); }, diff --git a/assets/javascripts/discourse/models/custom-wizard-api.js.es6 b/assets/javascripts/discourse/models/custom-wizard-api.js.es6 index 6cfbae06..6817ae70 100644 --- a/assets/javascripts/discourse/models/custom-wizard-api.js.es6 +++ b/assets/javascripts/discourse/models/custom-wizard-api.js.es6 @@ -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({ diff --git a/assets/javascripts/discourse/routes/admin-wizards-api.js.es6 b/assets/javascripts/discourse/routes/admin-wizards-api.js.es6 index 34320924..dda7d416 100644 --- a/assets/javascripts/discourse/routes/admin-wizards-api.js.es6 +++ b/assets/javascripts/discourse/routes/admin-wizards-api.js.es6 @@ -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); }