Skip to content

Commit

Permalink
Merge pull request #9 from Lunawood/master
Browse files Browse the repository at this point in the history
fix: Recieve petName, petWeight variables as RequestBody.
  • Loading branch information
Lunawood authored Dec 5, 2024
2 parents 46bedd5 + 48c416a commit 8a8f6c9
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

import java.util.Objects;

import javax.validation.Valid;

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.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
Expand Down Expand Up @@ -88,8 +91,7 @@ public ResponseEntity<?> mypageGetinfo(@RequestHeader("AccessToken") String Acce
@PatchMapping("/setinfo")
public ResponseEntity<?> mypageGetinfo(
@RequestHeader("AccessToken") String AccessToken,
@RequestHeader("PetName") String PetName,
@RequestHeader("PetWeight") Integer PetWeight
@Valid @RequestBody UserPet userPet
) {
// 1. RefreshToken Valid?
try {
Expand All @@ -112,7 +114,7 @@ public ResponseEntity<?> mypageGetinfo(
}

try {
userService.setPetInformation(userId, PetName, PetWeight);
userService.setPetInformation(userId, userPet.getPetName(), userPet.getPetWeight());
} catch (Exception e) {
throw new CException(ErrorCode.INTERNAL_SERVER_ERROR);
}
Expand Down

0 comments on commit 8a8f6c9

Please sign in to comment.