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

Steven Tey605238469245
diff --git a/apps/web/app/api/misc/check-workspace-slug/route.ts b/apps/web/app/api/misc/check-workspace-slug/route.ts
index 6f99e81377..ab6925e04f 100644
--- a/apps/web/app/api/misc/check-workspace-slug/route.ts
+++ b/apps/web/app/api/misc/check-workspace-slug/route.ts
@@ -6,6 +6,14 @@ import { NextResponse } from "next/server";
// GET /api/misc/check-workspace-slug – check if a workspace slug is available
export const GET = withSession(async ({ searchParams }) => {
const { slug } = searchParams;
+
+ if (!slug) {
+ return NextResponse.json(
+ { error: "Slug parameter is required" },
+ { status: 400 },
+ );
+ }
+
if (RESERVED_SLUGS.includes(slug) || DEFAULT_REDIRECTS[slug]) {
return NextResponse.json(1);
}