Skip to content

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

fix: dataroom name change all plans

Marc Seitz5e050c7e9d8a
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/index.ts b/pages/api/teams/[teamId]/datarooms/[id]/index.ts
index 0d2b5686..467b2199 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/index.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/index.ts
@@ -89,20 +89,24 @@ export default async function handle(
return res.status(401).end("Unauthorized");
}
+ const { name, enableChangeNotifications } = req.body as {
+ name?: string;
+ enableChangeNotifications?: boolean;
+ };
+
const featureFlags = await getFeatureFlags({ teamId: team.id });
const isDataroomsPlus = team.plan.includes("datarooms-plus");
- if (!isDataroomsPlus && !featureFlags.roomChangeNotifications) {
+ if (
+ enableChangeNotifications !== undefined &&
+ !isDataroomsPlus &&
+ !featureFlags.roomChangeNotifications
+ ) {
return res.status(403).json({
message: "This feature is not available in your plan",
});
}
- const { name, enableChangeNotifications } = req.body as {
- name?: string;
- enableChangeNotifications?: boolean;
- };
-
const dataroom = await prisma.dataroom.update({
where: {
id: dataroomId,