filter by deleted

This commit is contained in:
Rimian Perkins 2019-09-25 13:39:23 +10:00
parent d4afe93a5d
commit 9d982307d5
2 changed files with 7 additions and 1 deletions

View File

@ -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" });

View File

@ -8,7 +8,7 @@
<th>{{i18n 'discourse_patrons.admin.plans.plan.interval'}}</th>
<th>{{i18n 'discourse_patrons.admin.plans.plan.amount'}}</th>
</thead>
{{#each model.plans as |plan|}}
{{#each plans as |plan|}}
<tr>
<td>{{plan.id}}</td>
<td>{{plan.nickname}}</td>