From 6099bfb4ee5904ea73bb0dbd2c1e94b53172a747 Mon Sep 17 00:00:00 2001 From: Agusti Fernandez Pardo Date: Mon, 23 May 2022 23:23:53 +0200 Subject: [PATCH] fix: more logging --- lib/helpers/verifyApiKey.ts | 1 + pages/api/event-types/index.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/helpers/verifyApiKey.ts b/lib/helpers/verifyApiKey.ts index 38fa6b44c3..11d481815e 100644 --- a/lib/helpers/verifyApiKey.ts +++ b/lib/helpers/verifyApiKey.ts @@ -40,5 +40,6 @@ export const verifyApiKey: NextMiddleware = async (req, res, next) => { if (!apiKey.userId) return res.status(404).json({ error: "No user found for this apiKey" }); /* We save the user id in the request for later use */ req.userId = apiKey.userId; + console.log(`User ${apiKey.userId} verified`); await next(); }; diff --git a/pages/api/event-types/index.ts b/pages/api/event-types/index.ts index 1ab736eec2..ccbf79d7ca 100644 --- a/pages/api/event-types/index.ts +++ b/pages/api/event-types/index.ts @@ -33,7 +33,7 @@ async function createOrlistAllEventTypes( const data = await prisma.eventType .findMany({ where: { userId } }) .catch((error) => res.status(404).json({ message: "No event types were found", error })); - console.log("eventTypes:", data); + console.log(`userid is: ${userId}`, "eventTypes:", data); // const event_types = data.map( // async (eventType) => await schemaEventTypeReadPublic.safeParseAsync(eventType) // );