change wishlist toogle

This commit is contained in:
2025-05-29 23:17:54 +02:00
parent 6363f966f6
commit f4c8177270

View File

@@ -24,10 +24,10 @@ public class WishlistController {
this.noticeService = noticeService; this.noticeService = noticeService;
} }
@PostMapping("/toggle") @PostMapping("/toggle/{noticeId}")
public ResponseEntity<RequestResponseDTO> toggleWishlist(@RequestBody WishlistDTO wishlistDTO) { public ResponseEntity<RequestResponseDTO> toggleWishlist(@PathVariable Long noticeId) {
Long noticeId = wishlistDTO.getNoticeId();
Long clientId = wishlistDTO.getClientId(); Long clientId = 1L;
NoticeDTO noticeDTO = noticeService.getNoticeById(noticeId); NoticeDTO noticeDTO = noticeService.getNoticeById(noticeId);
if (noticeDTO == null) { if (noticeDTO == null) {
return ResponseEntity.badRequest().body(new RequestResponseDTO("Notice not found")); return ResponseEntity.badRequest().body(new RequestResponseDTO("Notice not found"));