Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-25 18:50:27 +01:00
initialize auth params and endpoints in the route & model
Dieser Commit ist enthalten in:
Ursprung
65979e1987
Commit
6345083c4d
3 geänderte Dateien mit 3 neuen und 9 gelöschten Zeilen
|
@ -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({});
|
||||
},
|
||||
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Laden …
In neuem Issue referenzieren