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

14 lines
268 B
JavaScript

import { ajax } from "discourse/lib/ajax";
const Plan = Discourse.Model.extend({});
Plan.reopenClass({
findAll() {
return ajax("/patrons/plans", { method: "get" }).then(result =>
result.map(plan => Plan.create(plan))
);
}
});
export default Plan;