Skip to content
Snippets Groups Projects
Commit e717cdca authored by Rémi PAILHAREY's avatar Rémi PAILHAREY :fork_knife_plate:
Browse files

feat(profile): logged in users can access the profile of other users

parent 25b2529a
No related branches found
No related tags found
4 merge requests!247V2.1.0,!242V2.0,!185Feat/us178 user profile,!127V2.0
......@@ -197,7 +197,11 @@ export class UsersController {
@Get(':id')
@ApiParam({ name: 'id', type: String, required: true })
public async getUser(@Param() params): Promise<IUser> {
return this.usersService.findById(params.id);
const user = await this.usersService.findById(params.id);
if (!user) {
throw new HttpException('User does not exist', HttpStatus.NOT_FOUND);
}
return user;
}
@ApiResponse({ status: HttpStatus.CREATED, description: 'Description updated' })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment