The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Throw an error when they try to change a default workspace folder's permission to no access
Kiran Ka2cc7f244bd2
diff --git a/apps/web/app/api/folders/[folderId]/route.ts b/apps/web/app/api/folders/[folderId]/route.tsindex db3aebc462..0b817418a3 100644--- a/apps/web/app/api/folders/[folderId]/route.ts+++ b/apps/web/app/api/folders/[folderId]/route.ts@@ -68,6 +68,14 @@ export const PATCH = withWorkspace(requiredPermission: "folders.write",});+ if (workspace.defaultFolderId === folderId && accessLevel === null) {+ throw new DubApiError({+ code: "conflict",+ message:+ "This is the workspace's default folder and cannot be set to no access.",+ });+ }+try {const updatedFolder = await prisma.folder.update({where: {