Skip to content

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

chore: sort dataroom folders alphabetically by default

Marc Seitzc69922f274e7
diff --git a/pages/api/links/[id]/dataroom.ts b/pages/api/links/[id]/dataroom.ts
index 513a03e5..51e74d31 100644
--- a/pages/api/links/[id]/dataroom.ts
+++ b/pages/api/links/[id]/dataroom.ts
@@ -62,7 +62,11 @@ export default async function handle(
},
},
},
- folders: true,
+ folders: {
+ orderBy: {
+ name: "asc",
+ },
+ },
},
},
},
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/folders/[...name].ts b/pages/api/teams/[teamId]/datarooms/[id]/folders/[...name].ts
index ce8f2fad..609e59f2 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/folders/[...name].ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/folders/[...name].ts
@@ -63,6 +63,9 @@ export default async function handle(
dataroomId,
parentId: parentFolder.id,
},
+ orderBy: {
+ name: "asc",
+ },
include: {
_count: {
select: { documents: true, childFolders: true },
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/folders/index.ts b/pages/api/teams/[teamId]/datarooms/[id]/folders/index.ts
index 3c17754b..2ab9771d 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/folders/index.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/folders/index.ts
@@ -47,6 +47,9 @@ export default async function handle(
dataroomId,
parentId: null,
},
+ orderBy: {
+ name: "asc",
+ },
include: {
_count: {
select: { documents: true, childFolders: true },
@@ -61,6 +64,9 @@ export default async function handle(
where: {
dataroomId,
},
+ orderBy: {
+ name: "asc",
+ },
include: {
documents: {
select: {