url for edit

This commit is contained in:
Rimian Perkins 2019-09-27 09:42:32 +10:00
parent 9d982307d5
commit bee940e672
3 changed files with 6 additions and 1 deletions

View File

@ -10,6 +10,10 @@ export default Ember.Controller.extend({
actions: {
deletePlan(id) {
return ajax(`/patrons/admin/plans/${id}`, { method: "delete" });
},
editPlan(id) {
return DiscourseURL.redirectTo(`/admin/plugins/discourse-patrons/plans/${id}`);
}
}
});

View File

@ -1,7 +1,7 @@
import { ajax } from "discourse/lib/ajax";
export default Discourse.Route.extend({
model(params) {
model() {
return ajax("/patrons/admin/subscriptions", { method: "get" });
}
});

View File

@ -15,6 +15,7 @@
<td>{{plan.interval}}</td>
<td>{{plan.amount}}</td>
<td>
{{d-button action=(action "editPlan" plan.id) icon="far-edit" class="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>