2019-12-12 19:54:32 -05:00
|
|
|
import Route from "@ember/routing/route";
|
2019-12-02 02:58:14 -05:00
|
|
|
import Product from "discourse/plugins/discourse-subscriptions/discourse/models/product";
|
|
|
|
import Plan from "discourse/plugins/discourse-subscriptions/discourse/models/plan";
|
2020-05-28 11:32:57 -04:00
|
|
|
import { hash } from "rsvp";
|
2019-11-04 00:37:21 -05:00
|
|
|
|
2019-12-12 19:54:32 -05:00
|
|
|
export default Route.extend({
|
2019-11-04 00:37:21 -05:00
|
|
|
model(params) {
|
2019-11-06 04:59:35 -05:00
|
|
|
const product_id = params["subscription-id"];
|
2019-11-28 04:11:48 -05:00
|
|
|
|
2019-12-08 20:01:10 -05:00
|
|
|
const product = Product.find(product_id);
|
2019-12-17 00:31:58 -05:00
|
|
|
const plans = Plan.findAll({ product_id });
|
2019-11-04 00:37:21 -05:00
|
|
|
|
2020-05-28 11:32:57 -04:00
|
|
|
return hash({ plans, product });
|
2020-09-16 10:53:50 -04:00
|
|
|
},
|
2019-11-04 00:37:21 -05:00
|
|
|
});
|