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 route.ts

Kiran K2d859b8aeaac
diff --git a/apps/web/app/api/links/upsert/route.ts b/apps/web/app/api/links/upsert/route.ts
index 983727694c..5789fb1d6d 100644
--- a/apps/web/app/api/links/upsert/route.ts
+++ b/apps/web/app/api/links/upsert/route.ts
@@ -10,7 +10,10 @@ import { withWorkspace } from "@/lib/auth";
import { verifyFolderAccess } from "@/lib/folder/permissions";
import { NewLinkProps } from "@/lib/types";
import { sendWorkspaceWebhook } from "@/lib/webhook/publish";
-import { createLinkBodySchema, linkEventSchema } from "@/lib/zod/schemas/links";
+import {
+ createLinkBodySchemaAsync,
+ linkEventSchema,
+} from "@/lib/zod/schemas/links";
import { prisma } from "@dub/prisma";
import { deepEqual } from "@dub/utils";
import { waitUntil } from "@vercel/functions";
@@ -20,7 +23,7 @@ import { NextResponse } from "next/server";
export const PUT = withWorkspace(
async ({ req, headers, workspace, session }) => {
const bodyRaw = await parseRequestBody(req);
- const body = createLinkBodySchema.parse(bodyRaw);
+ const body = await createLinkBodySchemaAsync.parseAsync(bodyRaw);
const link = await prisma.link.findFirst({
where: {