| 2 | import { StatusCodes } from "http-status-codes"; |
| 3 | |
| 4 | export class MeController { |
| 5 | async handle(req, res) { |
| 6 | const user = await findUserById(req.userId); |
| 7 | |
| 8 | if (!user) { |
| 9 | return res |
| 10 | .status(StatusCodes.NOT_FOUND) |
| 11 | .json({ |
| 12 | error: true, |
| 13 | message: "Usuário não encontrado", |
| 14 | }); |
| 15 | } |
| 16 | |
| 17 | return res |
| 18 | .status(StatusCodes.OK) |
| 19 | .json({ |
| 20 | id: user.id, |
| 21 | name: user.name, |
| 22 | email: user.email, |
| 23 | }); |
| 24 | } |
| 25 | } |
nothing calls this directly
no outgoing calls
no test coverage detected