discourse-subscriptions/assets/javascripts/discourse/models/plan.js.es6

14 lines
271 B
Plaintext
Raw Normal View History

2019-10-08 04:37:22 -04:00
import { ajax } from "discourse/lib/ajax";
2019-10-09 22:52:55 -04:00
const Plan = Discourse.Model.extend({});
2019-10-08 04:37:22 -04:00
Plan.reopenClass({
find() {
2019-10-09 22:52:55 -04:00
return ajax("/patrons/plans", { method: "get" }).then(result =>
2019-10-08 18:11:02 -04:00
result.plans.map(plan => Plan.create(plan))
);
2019-10-08 04:37:22 -04:00
}
});
export default Plan;