Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
chore: undo email notifications
Marc Seitz43fe1ce52cc3
diff --git a/pages/api/links/[id]/documents/[documentId].ts b/pages/api/links/[id]/documents/[documentId].tsindex 09524242..31c9f8d8 100644--- a/pages/api/links/[id]/documents/[documentId].ts+++ b/pages/api/links/[id]/documents/[documentId].ts@@ -6,7 +6,6 @@ import { fetchDataroomDocumentLinkData } from "@/lib/api/links/link-data";import { errorhandler } from "@/lib/errorHandler";import prisma from "@/lib/prisma";import { checkGlobalBlockList } from "@/lib/utils/global-block-list";-import { sendBlockedEmailAttemptNotification } from "@/lib/emails/send-blocked-email-attempt";export default async function handle(req: NextApiRequest,@@ -28,7 +27,6 @@ export default async function handle(where: { id, linkType: "DATAROOM_LINK" },select: {id: true,- name: true,expiresAt: true,emailProtected: true,emailAuthenticated: true,@@ -101,36 +99,6 @@ export default async function handle(return res.status(400).json({ message: globalBlockCheck.error });}if (globalBlockCheck.isBlocked) {- try {- const users = await prisma.userTeam.findMany({- where: {- role: { in: ["ADMIN", "MANAGER"] },- status: "ACTIVE",- teamId: link.teamId!,- },- select: {- user: { select: { email: true } },- },- });- const adminEmails = users.map((u) => u.user.email).filter((e): e is string => !!e);- const to = adminEmails[0];- const cc = adminEmails.slice(1);-- const dataroomDocument = await prisma.dataroomDocument.findUnique({- where: { id: dataroomDocumentId },- select: { document: { select: { name: true } } },- });-- await sendBlockedEmailAttemptNotification({- to,- cc,- blockedEmail: email!,- linkName: link.name || `Link #${link.id.slice(-5)}`,- resourceName: `dataroom document ${dataroomDocument?.document?.name}`,- });- } catch (e) {- console.error(e);- }return res.status(403).json({ message: "Access denied" });}diff --git a/pages/api/links/[id]/index.ts b/pages/api/links/[id]/index.tsindex 308dacbc..4eb7425b 100644--- a/pages/api/links/[id]/index.ts+++ b/pages/api/links/[id]/index.ts@@ -17,7 +17,6 @@ import { checkGlobalBlockList } from "@/lib/utils/global-block-list";import { DomainObject } from "..";import { authOptions } from "../../auth/[...nextauth]";-import { notifyBlockedAttempt } from "@/app/api/views-dataroom/route";export default async function handle(req: NextApiRequest,@@ -35,7 +34,6 @@ export default async function handle(},select: {id: true,- name: true,expiresAt: true,emailProtected: true,emailAuthenticated: true,@@ -111,9 +109,6 @@ export default async function handle(return res.status(400).json({ message: globalBlockCheck.error });}if (globalBlockCheck.isBlocked) {- try {- await notifyBlockedAttempt(link, email!);- } catch (e) { console.error(e); }return res.status(403).json({ message: "Access denied" });}diff --git a/pages/api/links/domains/[...domainSlug].ts b/pages/api/links/domains/[...domainSlug].tsindex 874f1226..37a5310f 100644--- a/pages/api/links/domains/[...domainSlug].ts+++ b/pages/api/links/domains/[...domainSlug].ts@@ -10,7 +10,6 @@ import {import prisma from "@/lib/prisma";import { log } from "@/lib/utils";import { checkGlobalBlockList } from "@/lib/utils/global-block-list";-import { notifyBlockedAttempt } from "@/app/api/views-dataroom/route";export default async function handle(req: NextApiRequest,@@ -45,7 +44,6 @@ export default async function handle(},select: {id: true,- name: true,expiresAt: true,emailProtected: true,allowDownload: true,@@ -131,9 +129,6 @@ export default async function handle(return res.status(400).json({ message: globalBlockCheck.error });}if (globalBlockCheck.isBlocked) {- try {- await notifyBlockedAttempt(link, email!);- } catch (e) { console.error(e); }return res.status(403).json({ message: "Access denied" });}