url for edit
This commit is contained in:
parent
9d982307d5
commit
bee940e672
|
@ -10,6 +10,10 @@ export default Ember.Controller.extend({
|
||||||
actions: {
|
actions: {
|
||||||
deletePlan(id) {
|
deletePlan(id) {
|
||||||
return ajax(`/patrons/admin/plans/${id}`, { method: "delete" });
|
return ajax(`/patrons/admin/plans/${id}`, { method: "delete" });
|
||||||
|
},
|
||||||
|
|
||||||
|
editPlan(id) {
|
||||||
|
return DiscourseURL.redirectTo(`/admin/plugins/discourse-patrons/plans/${id}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
|
|
||||||
export default Discourse.Route.extend({
|
export default Discourse.Route.extend({
|
||||||
model(params) {
|
model() {
|
||||||
return ajax("/patrons/admin/subscriptions", { method: "get" });
|
return ajax("/patrons/admin/subscriptions", { method: "get" });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
<td>{{plan.interval}}</td>
|
<td>{{plan.interval}}</td>
|
||||||
<td>{{plan.amount}}</td>
|
<td>{{plan.amount}}</td>
|
||||||
<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"}}
|
{{d-button action=(action "deletePlan" plan.id) icon="trash-alt" class="btn-danger btn no-text btn-icon"}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue