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.

Handle "unsorted" folderId

Tim Wilson7d41789445e6
diff --git a/apps/web/ui/modals/link-builder/index.tsx b/apps/web/ui/modals/link-builder/index.tsx
index 35b09d224b..0eb02a878c 100644
--- a/apps/web/ui/modals/link-builder/index.tsx
+++ b/apps/web/ui/modals/link-builder/index.tsx
@@ -247,11 +247,16 @@ function LinkBuilderInner({
ref={formRef}
onSubmit={handleSubmit(async (data) => {
// @ts-ignore – exclude extra attributes from `data` object before sending to API
- const { user, tags, tagId, ...rest } = data;
+ const { user, tags, tagId, folderId, ...rest } = data;
const bodyData = {
...rest,
+
// Map tags to tagIds
tagIds: tags.map(({ id }) => id),
+
+ // Replace "unsorted" folder ID w/ null
+ folderId: folderId === "unsorted" ? null : folderId,
+
// Manually reset empty strings to null
expiredUrl: rest.expiredUrl || null,
ios: rest.ios || null,