use of com.furyviewer.domain.ReviewMovie in project FuryViewer by TheDoctor-95.
the class ReviewMovieResource method updateReviewMovie.
/**
* PUT /review-movies : Updates an existing reviewMovie.
*
* @param reviewMovie the reviewMovie to update
* @return the ResponseEntity with status 200 (OK) and with body the updated reviewMovie,
* or with status 400 (Bad Request) if the reviewMovie is not valid,
* or with status 500 (Internal Server Error) if the reviewMovie couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/review-movies")
@Timed
public ResponseEntity<ReviewMovie> updateReviewMovie(@RequestBody ReviewMovie reviewMovie) throws URISyntaxException {
log.debug("REST request to update ReviewMovie : {}", reviewMovie);
if (reviewMovie.getId() == null) {
return createReviewMovie(reviewMovie);
}
ReviewMovie result = reviewMovieRepository.save(reviewMovie);
return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, reviewMovie.getId().toString())).body(result);
}
Aggregations