I am trying to create a movie springboot application and I am trying to get my Genre table to populate in my movies table. I am having errors with mismatch type.
@PostMapping("/movies/{movie_id}/genre")
@ResponseStatus(code = HttpStatus.CREATED)
public GenresData insertGenres(@PathVariable Long movie_id,
@RequestBody GenresData genresData) {
log.info("Creating genre {} for movies with ID={}", movie_id,
genresData);
return moviesService.saveGenres(movie_id, genresData);
}}
for(Movies movie : genres.getMovies()) {
movies.add(new MoviesData(movie));
}
What I am trying to do is when I do a POST request to add data to genres to show up in the movies table.