Response setup
With everything ready, the response can be set up and sent.
response.status(status).json({
statusCode: status,
message,
error,
});const user = await this.usersRepository.findOneBy({ id });
if (!user) {
throw new NotFoundException('User not found');
}
return user;return this.usersRepository.findOneByOrFail({ id });Last updated