diff --git a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-show-plans-show.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-show-plans-show.js.es6 index fdfc7d8..b0223f4 100644 --- a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-show-plans-show.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-show-plans-show.js.es6 @@ -33,13 +33,19 @@ export default Ember.Controller.extend({ this.get("model.plan") .save() - .then(() => this.redirect(this.productId)); + .then(() => this.redirect(this.productId)) + .catch(data => + bootbox.alert(data.jqXHR.responseJSON.errors.join("\n")) + ); }, updatePlan() { this.get("model.plan") .update() - .then(() => this.redirect(this.productId)); + .then(() => this.redirect(this.productId)) + .catch(data => + bootbox.alert(data.jqXHR.responseJSON.errors.join("\n")) + ); } } }); diff --git a/assets/javascripts/discourse/models/subscription.js.es6 b/assets/javascripts/discourse/models/subscription.js.es6 index 574113c..02b8288 100644 --- a/assets/javascripts/discourse/models/subscription.js.es6 +++ b/assets/javascripts/discourse/models/subscription.js.es6 @@ -34,7 +34,7 @@ Subscription.reopenClass({ return ajax("/patrons/subscriptions", { method: "get" }).then(result => result.map(subscription => { subscription.plan = Plan.create(subscription.plan); - return Subscription.create(subscription) + return Subscription.create(subscription); }) ); }