Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix: trim empty space from foldername

Marc Seitzcc6d03a98ce6
diff --git a/components/folders/add-folder-modal.tsx b/components/folders/add-folder-modal.tsx
index 9f2d6005..7da9981e 100644
--- a/components/folders/add-folder-modal.tsx
+++ b/components/folders/add-folder-modal.tsx
@@ -71,7 +71,7 @@ export function AddFolderModal({
"Content-Type": "application/json",
},
body: JSON.stringify({
- name: folderName,
+ name: folderName.trim(),
path: currentFolderPath?.join("/"),
}),
},
@@ -86,7 +86,7 @@ export function AddFolderModal({
const { parentFolderPath } = await response.json();
- analytics.capture("Folder Added", { folderName: folderName });
+ analytics.capture("Folder Added", { folderName: folderName.trim() });
toast.success("Folder added successfully! 🎉");
mutate(
diff --git a/components/folders/edit-folder-modal.tsx b/components/folders/edit-folder-modal.tsx
index 83fd89e0..48611079 100644
--- a/components/folders/edit-folder-modal.tsx
+++ b/components/folders/edit-folder-modal.tsx
@@ -61,7 +61,7 @@ export function EditFolderModal({
},
body: JSON.stringify({
folderId: folderId,
- name: folderName,
+ name: folderName.trim(),
}),
},
);