diff --git a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans-index.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans-index.js.es6 index bb6314a..097284c 100644 --- a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans-index.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans-index.js.es6 @@ -1,6 +1,12 @@ import { ajax } from "discourse/lib/ajax"; +import computed from "ember-addons/ember-computed-decorators"; export default Ember.Controller.extend({ + @computed("model.plans") + plans(plans) { + return plans.filter(plan => !plan.deleted); + }, + actions: { deletePlan(id) { return ajax(`/patrons/admin/plans/${id}`, { method: "delete" }); diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-plans-index.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-plans-index.hbs index f0fae54..be1ddd0 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-plans-index.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-plans-index.hbs @@ -8,7 +8,7 @@ {{i18n 'discourse_patrons.admin.plans.plan.interval'}} {{i18n 'discourse_patrons.admin.plans.plan.amount'}} - {{#each model.plans as |plan|}} + {{#each plans as |plan|}} {{plan.id}} {{plan.nickname}}