Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

update domain

Kiran Kc734c708d472
diff --git a/apps/web/app/api/stripe/webhook/route.ts b/apps/web/app/api/stripe/webhook/route.ts
index a0c9cfad2b..8d00a391a9 100644
--- a/apps/web/app/api/stripe/webhook/route.ts
+++ b/apps/web/app/api/stripe/webhook/route.ts
@@ -1,8 +1,6 @@
-import { updateDomain } from "@/lib/api/domains/update-domain";
import { limiter } from "@/lib/cron/limiter";
import { prisma } from "@/lib/prisma";
import { stripe } from "@/lib/stripe";
-import { WorkspaceProps } from "@/lib/types";
import { redis } from "@/lib/upstash";
import { FREE_PLAN, getPlanFromPriceId, log } from "@dub/utils";
import { sendEmail } from "emails";
@@ -263,11 +261,17 @@ export const POST = async (req: Request) => {
}),
),
workspace.domains.forEach((domain) => {
- updateDomain({
- slug: domain.slug,
- target: null,
- noindex: false,
- workspace: workspace as unknown as WorkspaceProps,
+ // TODO:
+ // We may want to update Redis as well
+
+ prisma.link.update({
+ where: {
+ id: domain.id,
+ },
+ data: {
+ url: "",
+ noindex: false,
+ },
});
}),
]);