mirror of
https://github.com/discourse/discourse-subscriptions.git
synced 2025-07-13 17:43:26 +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")
|
this.get("model.plan")
|
||||||
.save()
|
.save()
|
||||||
.then(() => this.redirect(this.productId));
|
.then(() => this.redirect(this.productId))
|
||||||
|
.catch(data =>
|
||||||
|
bootbox.alert(data.jqXHR.responseJSON.errors.join("\n"))
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
updatePlan() {
|
updatePlan() {
|
||||||
this.get("model.plan")
|
this.get("model.plan")
|
||||||
.update()
|
.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 =>
|
return ajax("/patrons/subscriptions", { method: "get" }).then(result =>
|
||||||
result.map(subscription => {
|
result.map(subscription => {
|
||||||
subscription.plan = Plan.create(subscription.plan);
|
subscription.plan = Plan.create(subscription.plan);
|
||||||
return Subscription.create(subscription)
|
return Subscription.create(subscription);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user