🐛 (billing) Only fetch active subscriptions

This commit is contained in:
Baptiste Arnaud
2023-05-05 11:02:59 -04:00
parent 8b3a690809
commit 98a21f3a9e
3 changed files with 5 additions and 0 deletions

View File

@@ -59,6 +59,8 @@ export const cancelSubscription = async (stripeId: string) => {
const currentSubscriptionId = (
await stripe.subscriptions.list({
customer: stripeId,
limit: 1,
status: 'active',
})
).data.shift()?.id
if (currentSubscriptionId)