Skip to content

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

feat: update folder document counts in current and new path

Marc Seitzfd42257afdc6
diff --git a/components/datarooms/move-dataroom-folder-modal.tsx b/components/datarooms/move-dataroom-folder-modal.tsx
index 0d367412..3e9dbef1 100644
--- a/components/datarooms/move-dataroom-folder-modal.tsx
+++ b/components/datarooms/move-dataroom-folder-modal.tsx
@@ -101,6 +101,14 @@ export function MoveToDataroomFolderModal({
mutate(
`/api/teams/${teamId}/datarooms/${dataroomId}${newPath ? `/folders/documents${newPath}` : "/documents"}`,
);
+ // update folder document counts in new path
+ mutate(
+ `/api/teams/${teamId}/datarooms/${dataroomId}/folders${newPath ? `${newPath}` : "?root=true"}`,
+ );
+ // update folder document counts in current path
+ mutate(
+ `/api/teams/${teamId}/datarooms/${dataroomId}/folders${currentPath !== "" ? `/${currentPath}` : "?root=true"}`,
+ );
toast.success("Document moved successfully!");
} catch (error) {