Skip to content

Commit

Permalink
User solution fetches only private solutions
Browse files Browse the repository at this point in the history
Signed-off-by: Noé Samaille <noe.samaille@ibm.com>
  • Loading branch information
NoeSamaille committed Apr 15, 2022
1 parent 434a5a7 commit 87097e9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/controllers/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,13 @@ export class UserController {
async findUserSolutionsById(
@param.path.string('id') email: string,
): Promise<Solution[]> {
const publicFilter = {
where: {
public: false
}
}
await this.userRepository.findById(email);
return this.userRepository.solutions(email).find();
return this.userRepository.solutions(email).find(publicFilter);
}

@patch('/users/{id}')
Expand Down

0 comments on commit 87097e9

Please sign in to comment.