2019-12-12 19:54:32 -05:00
|
|
|
import Route from "@ember/routing/route";
|
2019-12-02 02:58:14 -05:00
|
|
|
import Plan from "discourse/plugins/discourse-subscriptions/discourse/models/plan";
|
2024-01-16 11:51:44 -05:00
|
|
|
import Product from "discourse/plugins/discourse-subscriptions/discourse/models/product";
|
2020-10-21 14:36:31 -04:00
|
|
|
import Subscription from "discourse/plugins/discourse-subscriptions/discourse/models/subscription";
|
2019-11-04 00:37:21 -05:00
|
|
|
|
2024-11-29 10:42:50 -05:00
|
|
|
export default class SubscribeShowRoute extends Route {
|
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
|
|
|
|
2020-10-21 14:36:31 -04: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 00:37:21 -05:00
|
|
|
|
2020-10-21 14:36:31 -04:00
|
|
|
return result;
|
|
|
|
});
|
2024-11-29 10:42:50 -05:00
|
|
|
}
|
|
|
|
}
|