save the product

This commit is contained in:
Rimian Perkins
2019-10-16 14:15:01 +11:00
parent e2f1f0f523
commit 496f2b9706
14 changed files with 141 additions and 38 deletions
@@ -3,7 +3,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
export default Ember.Controller.extend({
actions: {
createPlan() {
this.get("model")
this.get("model.plan")
.save()
.then(() => {
this.transitionToRoute("adminPlugins.discourse-patrons.plans");
@@ -17,6 +17,15 @@ export default Ember.Controller.extend({
this.transitionToRoute("adminPlugins.discourse-patrons.products");
})
.catch(popupAjaxError);
},
updateProduct() {
this.get("model.product")
.update()
.then(() => {
this.transitionToRoute("adminPlugins.discourse-patrons.products");
})
.catch(popupAjaxError);
}
}
});