From 0539afb16ede18f7c1e2d97309ef464163caa2e5 Mon Sep 17 00:00:00 2001 From: Josh Creek <8179928+jcreek@users.noreply.github.com> Date: Tue, 16 Jul 2024 19:46:32 +0100 Subject: [PATCH] feat(#22): Add todo comment and strong typing --- src/routes/api/webhook/stripe/+server.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/routes/api/webhook/stripe/+server.ts b/src/routes/api/webhook/stripe/+server.ts index 377d239..2695ebb 100644 --- a/src/routes/api/webhook/stripe/+server.ts +++ b/src/routes/api/webhook/stripe/+server.ts @@ -57,8 +57,11 @@ export const POST: RequestHandler = async ({ request }) => { break; case 'customer.created': case 'customer.updated': - console.log(event.data.object); - await createOrRetrieveCustomer(event.data.object); + // TODO - this should be passing the supabase customer uuid not the stripe customer id + await createOrRetrieveCustomer({ + email: (event.data.object as stripe.Customer).email!, + uuid: event.data.object.id + }); break; case 'customer.subscription.created': case 'customer.subscription.updated':