Cannot find the email of the customuser

{ "timestamp": "2024-06-17T18:10:06.641+00:00", "status": 400, "error": "Bad Request", "message": "User not found", "path": "/api/retour/history" } not sure how to fix it excactly
4 Replies
JavaBot
JavaBot•9mo ago
⌛ This post has been reserved for your question.
Hey @timo! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
JavaBot
JavaBot•9mo ago
Please format your code to make it more readable. For java, it should look like this:
​`​`​`​java
public void foo() {

}
​`​`​`​
​`​`​`​java
public void foo() {

}
​`​`​`​
Timo
TimoOP•9mo ago
public List<Retour> findRetoursByCustomUser(String userEmail){
CustomUser user = userRepository.findByEmail(userEmail).orElseThrow(
() -> new ResponseStatusException(HttpStatus.BAD_REQUEST, "User not found")
);
return this.retourRepository.findByCustomUser(user);
}
public List<Retour> findRetoursByCustomUser(String userEmail){
CustomUser user = userRepository.findByEmail(userEmail).orElseThrow(
() -> new ResponseStatusException(HttpStatus.BAD_REQUEST, "User not found")
);
return this.retourRepository.findByCustomUser(user);
}
get the throw because it can t find the email but not really sure how to fix it changed some security for an adminrol that is why it doesn t work anymore
JavaBot
JavaBot•9mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?