FIX: Admins unable to cancel a subscription for a user (#220)

This commit is contained in:
Blake Erickson
2024-07-12 14:33:04 -06:00
committed by GitHub
parent 0fca89a1f7
commit c02193943b
4 changed files with 16 additions and 11 deletions
@@ -25,7 +25,11 @@ export default class AdminCancelSubscription extends Component {
@label="yes_value"
@action={{fn
@model.cancelSubscription
(hash [email protected] refund=this.refund)
(hash
[email protected]
refund=this.refund
closeModal=@closeModal
)
}}
@icon="times"
@isLoading={{@model.subscription.loading}}
@@ -40,6 +40,8 @@ export default Controller.extend({
cancelSubscription(model) {
const subscription = model.subscription;
const refund = model.refund;
const closeModal = model.closeModal;
subscription.set("loading", true);
subscription
.destroy(refund)
@@ -52,6 +54,7 @@ export default Controller.extend({
)
.finally(() => {
subscription.set("loading", false);
closeModal();
});
},
});