fix: stripe customer fetch logic

This commit is contained in:
David Nguyen
2023-09-19 15:30:58 +10:00
parent cbe118b74f
commit 4d485940ea

View File

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