Skip to content

Commit

Permalink
fix api/subscription 500s
Browse files Browse the repository at this point in the history
  • Loading branch information
sspenst committed May 15, 2024
1 parent 8801488 commit 7e3edc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/api/subscription/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ export async function getSubscriptions(req: NextApiRequestWithAuth): Promise<[nu
}

// query payment methods on file
const paymentMethods = await stripe.paymentMethods.list({
customer: user?.stripeCustomerId,
const paymentMethods = !user?.stripeCustomerId ? undefined : await stripe.paymentMethods.list({
customer: user.stripeCustomerId,
type: 'card',
});

Expand Down

0 comments on commit 7e3edc7

Please sign in to comment.