2019-10-09 22:52:55 -04:00
|
|
|
import AdminPlan from "discourse/plugins/discourse-patrons/discourse/models/admin-plan";
|
2019-09-24 21:18:11 -04:00
|
|
|
|
|
|
|
export default Discourse.Route.extend({
|
|
|
|
model() {
|
2019-10-09 22:52:55 -04:00
|
|
|
return AdminPlan.find();
|
2019-10-08 04:37:22 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
destroyPlan(plan) {
|
|
|
|
bootbox.confirm(
|
2019-10-08 07:26:58 -04:00
|
|
|
I18n.t("discourse_patrons.admin.plans.operations.destroy.confirm"),
|
2019-10-08 04:37:22 -04:00
|
|
|
I18n.t("no_value"),
|
|
|
|
I18n.t("yes_value"),
|
|
|
|
confirmed => {
|
|
|
|
if (confirmed) {
|
|
|
|
this.controllerFor("adminPluginsDiscoursePatronsPlansIndex")
|
|
|
|
.get("model")
|
|
|
|
.removeObject(plan);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
2019-09-24 21:18:11 -04:00
|
|
|
}
|
|
|
|
});
|