Skip to content

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

fix

Marc Seitz6bfb5cead6e3
diff --git a/pages/api/file/notion/index.ts b/pages/api/file/notion/index.ts
index 04481dfe..e0a55d8d 100644
--- a/pages/api/file/notion/index.ts
+++ b/pages/api/file/notion/index.ts
@@ -1,6 +1,7 @@
import { NextApiRequest, NextApiResponse } from "next";
import notion from "@/lib/notion";
+import { log } from "@/lib/utils";
export default async function handle(
req: NextApiRequest,
@@ -8,12 +9,16 @@ export default async function handle(
) {
// We only allow POST requests
if (req.method !== "POST") {
- console.log("Method Not Allowed because method is", req.method);
+ await log({
+ message: `Method Not Allowed: ${req.method}`,
+ type: "error",
+ });
+
res.status(405).json({ message: "Method Not Allowed" });
return;
}
- // POST /api/notion
+ // POST /api/file/notion
const { pageId } = req.body as { pageId: string };