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 moving link to unsorted

Kiran K9092f1801c42
diff --git a/apps/web/lib/zod/schemas/links.ts b/apps/web/lib/zod/schemas/links.ts
index ace3ba53ae..82b0ff1a44 100644
--- a/apps/web/lib/zod/schemas/links.ts
+++ b/apps/web/lib/zod/schemas/links.ts
@@ -249,6 +249,7 @@ export const createLinkBodySchema = z.object({
),
folderId: z
.string()
+ .transform((v) => (v === "" ? null : v))
.nullish()
.describe("The unique ID existing folder to assign the short link to."),
comments: z.string().nullish().describe("The comments for the short link."),
diff --git a/apps/web/ui/folders/move-link-form.tsx b/apps/web/ui/folders/move-link-form.tsx
index 5759b725a5..6d3b45aff3 100644
--- a/apps/web/ui/folders/move-link-form.tsx
+++ b/apps/web/ui/folders/move-link-form.tsx
@@ -41,7 +41,7 @@ export const MoveLinkForm = ({
body: JSON.stringify({
linkIds: links.map(({ id }) => id),
data: {
- folderId: selectedFolderId === "unsorted" ? "" : selectedFolderId,
+ folderId: selectedFolderId === "unsorted" ? null : selectedFolderId,
},
}),
},