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.

add prefix

Kiran Kf0a80bd7ca76
diff --git a/apps/web/app/api/folders/route.ts b/apps/web/app/api/folders/route.ts
index e7b4077f33..4b96ff5a35 100644
--- a/apps/web/app/api/folders/route.ts
+++ b/apps/web/app/api/folders/route.ts
@@ -1,5 +1,5 @@
import { DubApiError, exceededLimitError } from "@/lib/api/errors";
-import { parseRequestBody } from "@/lib/api/utils";
+import { createId, parseRequestBody } from "@/lib/api/utils";
import { withWorkspace } from "@/lib/auth";
import { getFolders } from "@/lib/folder/get-folders";
import {
@@ -59,6 +59,7 @@ export const POST = withWorkspace(
try {
const newFolder = await prisma.folder.create({
data: {
+ id: createId({ prefix: "fd_" }),
projectId: workspace.id,
name,
accessLevel,
diff --git a/apps/web/lib/api/utils.ts b/apps/web/lib/api/utils.ts
index d1d0ead74d..4a15795c78 100644
--- a/apps/web/lib/api/utils.ts
+++ b/apps/web/lib/api/utils.ts
@@ -70,6 +70,7 @@ const prefixes = [
"pga_",
"dub_embed_",
"inv_",
+ "fd_",
] as const;
export const createId = ({