diff --git a/be/src/main/java/buddyguard/mybuddyguard/weight/contoller/WeightController.java b/be/src/main/java/buddyguard/mybuddyguard/weight/contoller/WeightController.java index e2200660..d2290c0e 100644 --- a/be/src/main/java/buddyguard/mybuddyguard/weight/contoller/WeightController.java +++ b/be/src/main/java/buddyguard/mybuddyguard/weight/contoller/WeightController.java @@ -2,12 +2,14 @@ import buddyguard.mybuddyguard.weight.dto.WeightCreateRequest; import buddyguard.mybuddyguard.weight.dto.WeightResponse; +import buddyguard.mybuddyguard.weight.dto.WeightUpdateRequest; import buddyguard.mybuddyguard.weight.service.WeightService; import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -42,4 +44,13 @@ public ResponseEntity<Void> createNewWeightRecord(@RequestBody WeightCreateReque weightService.createNewWeightRecord(request); return new ResponseEntity<>(HttpStatus.CREATED); } + + @PatchMapping("/{id}") + public ResponseEntity<Void> updateWeightRecord(@PathVariable("id") Long id, @RequestBody WeightUpdateRequest request) { + + weightService.updateWeightRecord(id, request); + + return new ResponseEntity<>(HttpStatus.OK); + } + }