Search in sources :

Example 6 with ReviewMovie

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);
}
Also used : ReviewMovie(com.furyviewer.domain.ReviewMovie) Timed(com.codahale.metrics.annotation.Timed)

Aggregations

ReviewMovie (com.furyviewer.domain.ReviewMovie)6 Timed (com.codahale.metrics.annotation.Timed)3 Test (org.junit.Test)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)3 Transactional (org.springframework.transaction.annotation.Transactional)3 BadRequestAlertException (com.furyviewer.web.rest.errors.BadRequestAlertException)1 URI (java.net.URI)1