mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Added subscription cancel action handler
no issue - Adds cancel/continue action handler for a subscription
This commit is contained in:
parent
7aa3a448f7
commit
9b899d4c54
1 changed files with 14 additions and 0 deletions
|
@ -88,6 +88,19 @@ async function updateSubscription({data, api}) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function cancelSubscription({data, api}) {
|
||||||
|
const {subscriptionId, cancelAtPeriodEnd} = data;
|
||||||
|
await api.member.updateSubscription({
|
||||||
|
subscriptionId, cancelAtPeriodEnd
|
||||||
|
});
|
||||||
|
const member = await api.member.sessionData();
|
||||||
|
return {
|
||||||
|
action: 'cancelSubscription:success',
|
||||||
|
page: 'accountHome',
|
||||||
|
member: member
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
async function editBilling({data, updateState, state, api}) {
|
async function editBilling({data, updateState, state, api}) {
|
||||||
await api.member.editBilling();
|
await api.member.editBilling();
|
||||||
}
|
}
|
||||||
|
@ -134,6 +147,7 @@ const Actions = {
|
||||||
signup,
|
signup,
|
||||||
updateEmail,
|
updateEmail,
|
||||||
updateSubscription,
|
updateSubscription,
|
||||||
|
cancelSubscription,
|
||||||
updateMember,
|
updateMember,
|
||||||
updateProfile,
|
updateProfile,
|
||||||
editBilling,
|
editBilling,
|
||||||
|
|
Loading…
Add table
Reference in a new issue