discourse-subscriptions/assets/javascripts/discourse/routes/patrons-subscribe.js.es6

14 lines
556 B
Plaintext
Raw Normal View History

2019-10-09 22:52:55 -04:00
import Group from "discourse/plugins/discourse-patrons/discourse/models/group";
import Plan from "discourse/plugins/discourse-patrons/discourse/models/plan";
2019-10-17 05:34:26 -04:00
import Subscription from "discourse/plugins/discourse-patrons/discourse/models/subscription";
2019-10-09 22:52:55 -04:00
export default Discourse.Route.extend({
model() {
const group = Group.find();
2019-10-17 05:34:26 -04:00
const plans = Plan.findAll().then(results => results.map(p => ({ id: p.id, name: p.nickname })));
const subscription = Subscription.create();
2019-10-16 21:07:06 -04:00
2019-10-17 05:34:26 -04:00
return Ember.RSVP.hash({ group, plans, subscription });
2019-10-09 22:52:55 -04:00
}
});