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