plan model with destroy and find

This commit is contained in:
Rimian Perkins
2019-10-08 19:37:22 +11:00
parent 6f9195a7d4
commit 19a03aa2ca
6 changed files with 56 additions and 15 deletions
@@ -0,0 +1,14 @@
import { ajax } from "discourse/lib/ajax";
const Plan = Discourse.Model.extend({
destroy() { }
});
Plan.reopenClass({
find() {
return ajax("/patrons/admin/plans", { method: "get" })
.then(result => result.plans.map(plan => Plan.create(plan)));
}
});
export default Plan;