Witam, mam funkcje commentRepository.findAllByPostId(postId), pobiera ona komentarze po id Postu, zwraca listę Komentarzy
(zamiast całego usera potrzebuje username )
Klasa Comment
Comment dto
widomo jeśli pobieramy jeden objekt (commentDto.setId(comment.getId) itd, ale gdy mamy listę to totalnie nie wiem jak sobie z tym poradzić
@CrossOrigin("*")
@GetMapping ("comment/{postId}")
public List<Comment> showCommentsForPost(@PathVariable Long postId){
//
return commentRepository.findAllByPostId(postId);
}
Pozdrawiam