fix: stripe customer fetch logic

This commit is contained in:
David Nguyen
2023-09-19 15:30:58 +10:00
committed by Mythie
parent 81eea4213c
commit 6d7fc32075

View File

@ -26,8 +26,10 @@ export const createBillingPortal = async () => {
}
}
// Fallback to check if a Stripe customer already exists for the current user.
stripeCustomer = await getStripeCustomerByEmail(user.email);
// Fallback to check if a Stripe customer already exists for the current user email.
if (!stripeCustomer) {
stripeCustomer = await getStripeCustomerByEmail(user.email);
}
// Create a Stripe customer if it does not exist for the current user.
if (!stripeCustomer) {