From 7e76946a07a4628920e97b9c615ee022d04dbb99 Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com> Date: Thu, 15 May 2025 19:32:25 +0530 Subject: [PATCH] fix(api): sending incorrect object in log (#60372) --- api/src/routes/public/user.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/src/routes/public/user.ts b/api/src/routes/public/user.ts index 97cd4f6b7c0..cd1bc2b518a 100644 --- a/api/src/routes/public/user.ts +++ b/api/src/routes/public/user.ts @@ -120,7 +120,7 @@ export const userPublicGetRoutes: FastifyPluginCallbackTypebox = ( } }, async (req, reply) => { - const logger = fastify.log.child({ req, reply }); + const logger = fastify.log.child({ req, res: reply }); logger.info({ username: req.query.username }); // TODO(Post-MVP): look for duplicates unless we can make username unique in the db. const user = await fastify.prisma.user.findFirst({ @@ -244,7 +244,11 @@ export const userPublicGetRoutes: FastifyPluginCallbackTypebox = ( where: { username } })) > 0; - logger.info(`User exists for username: ${username}`); + if (exists) { + logger.info(`User exists for username: ${username}`); + } else { + logger.info(`User does not exist for username: ${username}`); + } await reply.send({ exists }); } );