Skip to content

Commit

Permalink
Merge pull request #34 from FourPointSevenFive/fix-be/user-favorite-t…
Browse files Browse the repository at this point in the history
…oggle

fix(be) - change from PathVariable to RequestParam
  • Loading branch information
j1suk1m authored Dec 4, 2024
2 parents 604dadf + cd29b76 commit 7574fbf
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ public ResponseEntity<FavoriteResponseDto> getUserFavorite(
return ResponseEntity.ok(result);
}

@PostMapping("/favorite/on?location_id={locationId}")
@PostMapping(value = "/favorite/on", params = "location_id")
public ResponseEntity<Void> increaseFavoriteCount(
@AuthUser User user,
@PathVariable Long locationId
@RequestParam(name = "location_id") Long locationId
) {
favoriteService.increaseFavoriteCountAndSave(user, locationId);
return ResponseEntity.ok().build();
}

@DeleteMapping("/favorite/off?location_id={locationId}")
@DeleteMapping(value = "/favorite/off", params = "location_id")
public ResponseEntity<Void> decreaseFavoriteCount(
@AuthUser User user,
@PathVariable Long locationId
@RequestParam(name = "location_id") Long locationId
) {
favoriteService.decreaseFavoriteCountAndDelete(user, locationId);
return ResponseEntity.ok().build();
Expand Down

0 comments on commit 7574fbf

Please sign in to comment.