mirror of
https://github.com/mfts/papermark.git
synced 2025-12-20 01:03:24 +08:00
fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { NextApiResponse } from "next";
|
||||
|
||||
import { FREE_PLAN_LIMITS } from "@/ee/limits/constants";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import Stripe from "stripe";
|
||||
|
||||
import prisma from "@/lib/prisma";
|
||||
@@ -40,12 +41,24 @@ export async function customerSubscriptionDeleted(
|
||||
type: "info",
|
||||
});
|
||||
} catch (error) {
|
||||
if (
|
||||
error instanceof Prisma.PrismaClientKnownRequestError &&
|
||||
error.code === "P2025"
|
||||
) {
|
||||
await log({
|
||||
message: `Team with Stripe ID ${stripeId} and Subscription ID ${subscriptionId} not found`,
|
||||
type: "error",
|
||||
});
|
||||
return res
|
||||
.status(200)
|
||||
.send("Team not found in database. Customer deleted their account.");
|
||||
}
|
||||
await log({
|
||||
message: `Error updating team ${stripeId} subscription ${subscriptionId}: ${error}`,
|
||||
type: "error",
|
||||
});
|
||||
return res
|
||||
.status(200)
|
||||
.send("Team not found in database. Customer deleted their account.");
|
||||
.send("Error processing subscription deletion webhook.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export async function invoiceUpcoming(
|
||||
item.price.recurring.interval_count === 12)
|
||||
);
|
||||
}
|
||||
return res.status(200).json({ received: true });
|
||||
return false;
|
||||
});
|
||||
|
||||
if (!hasYearlyPlan) {
|
||||
|
||||
Reference in New Issue
Block a user