mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(api): sending incorrect object in log (#60372)
This commit is contained in:
committed by
GitHub
parent
e06c563a51
commit
7e76946a07
@@ -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 });
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user