api/src/main/java/com/codechallenge/api/controller/BoatController.java
@PutMapping("/boats/{id}")
	public ResponseEntity<Boat> updateBoat(@PathVariable(value = "id") Long boatId, @RequestBody BoatVO boatToUpdate)
			throws NoDataFoundException {

		Boat boat = boatRepository.findById(boatId)
				.orElseThrow(() -> new NoDataFoundException(NO_DATA_FOUND_ERROR  + boatId));

		boat.setStatus(boatToUpdate.getStatus());
		boat.setName(boatToUpdate.getName());
		final Boat boatAfterUpdate = boatRepository.save(boat);
		return ResponseEntity.ok(boatAfterUpdate);
	}
/**
	 * Update boat response entity.
	 *
	 * @param boatId      the boat id
	 * @param boatToUpdate the boat details
	 * @return the response entity
	 * @throws NoDataFoundException
	 */
Update boat response entity.
@param boatId      the boat id
@param boatToUpdate the boat details
@return the response entity
@throws NoDataFoundException
Update boat response entity . @param boatId the boat id @param boatToUpdate the boat details @return the response entity @throws NoDataFoundException
@PutMapping("/boats/{id}")
	public ResponseEntity<Boat> updateBoat(@PathVariable(value = "id") Long boatId, @RequestBody BoatVO boatToUpdate)
			throws NoDataFoundException {
		Boat boat = boatRepository.findById(boatId)
				.orElseThrow(() -> new NoDataFoundException(NO_DATA_FOUND_ERROR  + boatId));
		boat.setStatus(boatToUpdate.getStatus());
		boat.setName(boatToUpdate.getName());
		final Boat boatAfterUpdate = boatRepository.save(boat);
		return ResponseEntity.ok(boatAfterUpdate);
	}
@ PutMapping ( "/boats/{id}" ) public ResponseEntity < Boat > updateBoat ( @ PathVariable ( value = "id" ) Long boatId , @ RequestBody BoatVO boatToUpdate ) throws NoDataFoundException { Boat boat = boatRepository . findById ( boatId ) . orElseThrow ( ( ) -> new NoDataFoundException ( NO_DATA_FOUND_ERROR + boatId ) ) ; boat . setStatus ( boatToUpdate . getStatus ( ) ) ; boat . setName ( boatToUpdate . getName ( ) ) ; final Boat boatAfterUpdate = boatRepository . save ( boat ) ; return ResponseEntity . ok ( boatAfterUpdate ) ; }
Update boat response entity.
Update boat response entity .