Search in sources :

Example 6 with HatredSeries

use of com.furyviewer.domain.HatredSeries in project FuryViewer by TheDoctor-95.

the class HatredSeriesResource method updateHatredSeries.

/**
 * PUT  /hatred-series : Updates an existing hatredSeries.
 *
 * @param hatredSeries the hatredSeries to update
 * @return the ResponseEntity with status 200 (OK) and with body the updated hatredSeries,
 * or with status 400 (Bad Request) if the hatredSeries is not valid,
 * or with status 500 (Internal Server Error) if the hatredSeries couldn't be updated
 * @throws URISyntaxException if the Location URI syntax is incorrect
 */
@PutMapping("/hatred-series")
@Timed
public ResponseEntity<HatredSeries> updateHatredSeries(@RequestBody HatredSeries hatredSeries) throws URISyntaxException {
    log.debug("REST request to update HatredSeries : {}", hatredSeries);
    if (hatredSeries.getId() == null) {
        return createHatredSeries(hatredSeries);
    }
    HatredSeries result = hatredSeriesRepository.save(hatredSeries);
    return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, hatredSeries.getId().toString())).body(result);
}
Also used : HatredSeries(com.furyviewer.domain.HatredSeries) Timed(com.codahale.metrics.annotation.Timed)

Aggregations

HatredSeries (com.furyviewer.domain.HatredSeries)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