Search in sources :

Example 6 with RateSeries

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

the class RateSeriesResource method updateRateSeries.

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

Aggregations

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