mirror of
https://github.com/discourse/discourse-subscriptions.git
synced 2025-02-27 14:29:39 +00:00
feedback error when plan creates and updates
This commit is contained in:
parent
ced4d1c786
commit
1074d84901
@ -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"))
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -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);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user