The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
fix a few more spots
Steven Teyb5bc62f351a4
diff --git a/apps/web/app/api/workspaces/route.ts b/apps/web/app/api/workspaces/route.tsindex d20cf1ccf2..9b46717f96 100644--- a/apps/web/app/api/workspaces/route.ts+++ b/apps/web/app/api/workspaces/route.ts@@ -68,7 +68,7 @@ export const POST = withSession(async ({ req, session }) => {await req.json(),);- const freeProjects = await prisma.project.count({+ const freeWorkspaces = await prisma.project.count({where: {plan: "free",users: {@@ -80,7 +80,7 @@ export const POST = withSession(async ({ req, session }) => {},});- if (freeProjects >= FREE_WORKSPACES_LIMIT) {+ if (freeWorkspaces >= FREE_WORKSPACES_LIMIT) {throw new DubApiError({code: "exceeded_limit",message: `You can only create up to ${FREE_WORKSPACES_LIMIT} free workspaces. Additional workspaces require a paid plan.`,diff --git a/apps/web/app/app.dub.co/(redirects)/new/page.tsx b/apps/web/app/app.dub.co/(redirects)/new/page.tsxindex 3624dcc981..dba092a355 100644--- a/apps/web/app/app.dub.co/(redirects)/new/page.tsx+++ b/apps/web/app/app.dub.co/(redirects)/new/page.tsx@@ -2,9 +2,9 @@ import { getWorkspaces } from "@/lib/fetchers";import { redirect } from "next/navigation";export default async function NewLinkPage() {- const projects = await getWorkspaces();- if (!projects || projects.length === 0) {- redirect("/?newProject=true");+ const workspaces = await getWorkspaces();+ if (!workspaces || workspaces.length === 0) {+ redirect("/?newWorkspace=true");}- redirect(`/${projects[0].slug}?newLink=true`);+ redirect(`/${workspaces[0].slug}?newLink=true`);}diff --git a/apps/web/ui/modals/provider.tsx b/apps/web/ui/modals/provider.tsxindex 3d0a6e9aac..755b74f396 100644--- a/apps/web/ui/modals/provider.tsx+++ b/apps/web/ui/modals/provider.tsx@@ -102,7 +102,7 @@ export default function ModalProvider({ children }: { children: ReactNode }) {const searchParams = useSearchParams();- // handle ?newProject and ?newLink query params+ // handle ?newWorkspace and ?newLink query paramsuseEffect(() => {if (searchParams.has("newWorkspace")) {setShowAddWorkspaceModal(true);