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.

use parseAsync

Kiran Kbbd1ea729485
diff --git a/apps/web/app/api/domains/[domain]/route.ts b/apps/web/app/api/domains/[domain]/route.ts
index 5d641c8a54..96c72bfcea 100644
--- a/apps/web/app/api/domains/[domain]/route.ts
+++ b/apps/web/app/api/domains/[domain]/route.ts
@@ -56,7 +56,7 @@ export const PATCH = withWorkspace(
archived,
assetLinks,
appleAppSiteAssociation,
- } = updateDomainBodySchema.parse(await parseRequestBody(req));
+ } = await updateDomainBodySchema.parseAsync(await parseRequestBody(req));
if (workspace.plan === "free") {
if (
diff --git a/apps/web/app/api/oauth/apps/[appId]/route.ts b/apps/web/app/api/oauth/apps/[appId]/route.ts
index d65692414a..fc90f98cb6 100644
--- a/apps/web/app/api/oauth/apps/[appId]/route.ts
+++ b/apps/web/app/api/oauth/apps/[appId]/route.ts
@@ -64,7 +64,7 @@ export const PATCH = withWorkspace(
logo,
pkce,
screenshots,
- } = updateOAuthAppSchema.parse(await parseRequestBody(req));
+ } = await updateOAuthAppSchema.parseAsync(await parseRequestBody(req));
try {
const integration = await prisma.integration.findUniqueOrThrow({
diff --git a/apps/web/app/api/oauth/apps/route.ts b/apps/web/app/api/oauth/apps/route.ts
index f338ce0c6c..1046796c3a 100644
--- a/apps/web/app/api/oauth/apps/route.ts
+++ b/apps/web/app/api/oauth/apps/route.ts
@@ -56,7 +56,7 @@ export const POST = withWorkspace(
logo,
pkce,
screenshots,
- } = createOAuthAppSchema.parse(await parseRequestBody(req));
+ } = await createOAuthAppSchema.parseAsync(await parseRequestBody(req));
const integration = await prisma.integration.findUnique({
where: {
diff --git a/apps/web/lib/zod/schemas/misc.ts b/apps/web/lib/zod/schemas/misc.ts
index 4faeb3e6e7..d6b6a6479a 100644
--- a/apps/web/lib/zod/schemas/misc.ts
+++ b/apps/web/lib/zod/schemas/misc.ts
@@ -89,6 +89,8 @@ export const base64ImageSchema = z
.transform((v) => v || null);
// Base64 encoded image or dubassets.com URL
+// This schema contains an async refinement check for base64 image validation,
+// which requires using parseAsync() instead of parse() when validating
export const uploadedImageSchema = z
.union([
base64ImageSchema,