fix(api): sending incorrect object in log (#60372)

This commit is contained in:
Mrugesh Mohapatra
2025-05-15 19:32:25 +05:30
committed by GitHub
parent e06c563a51
commit 7e76946a07
+6 -2
View File
@@ -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 });
}
);