plans and products

This commit is contained in:
Rimian Perkins
2019-10-17 12:07:06 +11:00
parent 01b78b31df
commit e2b915b905
13 changed files with 107 additions and 40 deletions
@@ -3,6 +3,19 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
export default Ember.Controller.extend({
actions: {
createPlan() {
let product;
if(this.get("model.plan.product_id")) {
product = this.get("model.products")
.filterBy('id', this.get("model.plan.product_id"))
.get("firstObject");
}
else {
product = this.get("model.products").get("firstObject");
}
this.set("model.plan.product", product);
this.get("model.plan")
.save()
.then(() => {