2019-12-13 11:54:32 +11:00
|
|
|
import Route from "@ember/routing/route";
|
2019-12-02 18:58:14 +11:00
|
|
|
import Product from "discourse/plugins/discourse-subscriptions/discourse/models/product";
|
|
|
|
import Plan from "discourse/plugins/discourse-subscriptions/discourse/models/plan";
|
2020-10-21 13:36:31 -05:00
|
|
|
import Subscription from "discourse/plugins/discourse-subscriptions/discourse/models/subscription";
|
2019-11-04 16:37:21 +11:00
|
|
|
|
2019-12-13 11:54:32 +11:00
|
|
|
export default Route.extend({
|
2019-11-04 16:37:21 +11:00
|
|
|
model(params) {
|
2019-11-06 20:59:35 +11:00
|
|
|
const product_id = params["subscription-id"];
|
2019-11-28 20:11:48 +11:00
|
|
|
|
2020-10-21 13:36:31 -05:00
|
|
|
return Subscription.show(product_id).then((result) => {
|
|
|
|
result.product = Product.create(result.product);
|
|
|
|
result.plans = result.plans.map((plan) => {
|
|
|
|
return Plan.create(plan);
|
|
|
|
});
|
2019-11-04 16:37:21 +11:00
|
|
|
|
2020-10-21 13:36:31 -05:00
|
|
|
return result;
|
|
|
|
});
|
2020-09-16 09:53:50 -05:00
|
|
|
},
|
2019-11-04 16:37:21 +11:00
|
|
|
});
|