delete plans

This commit is contained in:
Rimian Perkins
2019-09-25 13:20:28 +10:00
parent 1b232a1bd4
commit d4afe93a5d
5 changed files with 26 additions and 7 deletions
@@ -1,5 +1,9 @@
import { ajax } from "discourse/lib/ajax";
export default Ember.Controller.extend({
actions: {
deletePlan(plan) {}
deletePlan(id) {
return ajax(`/patrons/admin/plans/${id}`, { method: "delete" });
}
}
});
@@ -15,7 +15,7 @@
<td>{{plan.interval}}</td>
<td>{{plan.amount}}</td>
<td>
{{d-button action=(action "deletePlan" plan) icon="trash" class="btn-danger btn no-text btn-icon"}}
{{d-button action=(action "deletePlan" plan.id) icon="trash-alt" class="btn-danger btn no-text btn-icon"}}
</td>
</tr>
{{/each}}