filter by deleted
This commit is contained in:
parent
d4afe93a5d
commit
9d982307d5
|
@ -1,6 +1,12 @@
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Ember.Controller.extend({
|
||||||
|
@computed("model.plans")
|
||||||
|
plans(plans) {
|
||||||
|
return plans.filter(plan => !plan.deleted);
|
||||||
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
deletePlan(id) {
|
deletePlan(id) {
|
||||||
return ajax(`/patrons/admin/plans/${id}`, { method: "delete" });
|
return ajax(`/patrons/admin/plans/${id}`, { method: "delete" });
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<th>{{i18n 'discourse_patrons.admin.plans.plan.interval'}}</th>
|
<th>{{i18n 'discourse_patrons.admin.plans.plan.interval'}}</th>
|
||||||
<th>{{i18n 'discourse_patrons.admin.plans.plan.amount'}}</th>
|
<th>{{i18n 'discourse_patrons.admin.plans.plan.amount'}}</th>
|
||||||
</thead>
|
</thead>
|
||||||
{{#each model.plans as |plan|}}
|
{{#each plans as |plan|}}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{plan.id}}</td>
|
<td>{{plan.id}}</td>
|
||||||
<td>{{plan.nickname}}</td>
|
<td>{{plan.nickname}}</td>
|
||||||
|
|
Loading…
Reference in New Issue