mirror of
https://github.com/baptisteArno/typebot.io.git
synced 2026-06-25 21:01:54 +08:00
🐛 Better manage newly created subscription in stripe webhook
This commit is contained in:
parent
a5db6dc0a1
commit
761602b3d2
@ -120,6 +120,11 @@ export const webhookHandler = async (
|
||||
const subscription = event.data.object as Stripe.Subscription;
|
||||
const previous = event.data.previous_attributes;
|
||||
|
||||
if (previous?.status === "incomplete")
|
||||
return res.send({
|
||||
message: "Subscription just created, skipping.",
|
||||
});
|
||||
|
||||
const existingWorkspace = await prisma.workspace.findFirst({
|
||||
where: {
|
||||
stripeId: subscription.customer as string,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user