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.

fix patch workspace route

Steven Tey8dcd0e8c48c0
diff --git a/apps/web/app/api/workspaces/[idOrSlug]/route.ts b/apps/web/app/api/workspaces/[idOrSlug]/route.ts
index 6d7a2190a5..63395ad0f5 100644
--- a/apps/web/app/api/workspaces/[idOrSlug]/route.ts
+++ b/apps/web/app/api/workspaces/[idOrSlug]/route.ts
@@ -18,20 +18,22 @@ import { nanoid, R2_URL } from "@dub/utils";
import { waitUntil } from "@vercel/functions";
import { NextResponse } from "next/server";
-const updateWorkspaceSchema = createWorkspaceSchema.extend({
- allowedHostnames: z.array(z.string()).optional(),
- publishableKey: z
- .union([
- z
- .string()
- .regex(
- /^dub_pk_[A-Za-z0-9_-]{16,64}$/,
- "Invalid publishable key format",
- ),
- z.null(),
- ])
- .optional(),
-});
+const updateWorkspaceSchema = createWorkspaceSchema
+ .extend({
+ allowedHostnames: z.array(z.string()).optional(),
+ publishableKey: z
+ .union([
+ z
+ .string()
+ .regex(
+ /^dub_pk_[A-Za-z0-9_-]{16,64}$/,
+ "Invalid publishable key format",
+ ),
+ z.null(),
+ ])
+ .optional(),
+ })
+ .partial();
// GET /api/workspaces/[idOrSlug] – get a specific workspace by id or slug
export const GET = withWorkspace(