From 92c4d3f0eb4d8c149280636bb7409aef375cef3f Mon Sep 17 00:00:00 2001 From: sseooh Date: Fri, 15 Nov 2024 16:40:59 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20group=20=ED=94=84=EB=A1=A0=ED=8A=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EB=B0=8F=20=EA=B7=B8=EB=A3=B9=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=ED=91=9C=EC=8B=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../devcard/card/controller/page/CardPageController.java | 6 +++++- src/main/resources/templates/card-list.html | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/devcard/devcard/card/controller/page/CardPageController.java b/src/main/java/com/devcard/devcard/card/controller/page/CardPageController.java index d105f07..25c5553 100644 --- a/src/main/java/com/devcard/devcard/card/controller/page/CardPageController.java +++ b/src/main/java/com/devcard/devcard/card/controller/page/CardPageController.java @@ -3,6 +3,7 @@ import com.devcard.devcard.auth.model.OauthMemberDetails; import com.devcard.devcard.card.dto.CardResponseDto; import com.devcard.devcard.card.dto.GroupResponseDto; +import com.devcard.devcard.card.repository.GroupRepository; import com.devcard.devcard.card.service.CardService; import com.devcard.devcard.card.service.GroupService; import org.springframework.beans.factory.annotation.Value; @@ -19,13 +20,15 @@ public class CardPageController { private final CardService cardService; private final GroupService groupService; + private final GroupRepository groupRepository; @Value("${kakao.javascript.key}") private String kakaoJavascriptKey; - public CardPageController(CardService cardService, GroupService groupService) { + public CardPageController(CardService cardService, GroupService groupService, GroupRepository groupRepository) { this.cardService = cardService; this.groupService = groupService; + this.groupRepository = groupRepository; } @GetMapping("/cards/{id}/view") @@ -55,6 +58,7 @@ public String updateCard(@PathVariable("id") Long id, Model model) { public String viewCardList(@PathVariable("id") Long groupId, Model model, @AuthenticationPrincipal OauthMemberDetails oauthMemberDetails) { List cards = cardService.getCardsByGroup(groupId, oauthMemberDetails.getMember()); model.addAttribute("cards", cards); + model.addAttribute("group", groupRepository.findById(groupId).get()); return "card-list"; } diff --git a/src/main/resources/templates/card-list.html b/src/main/resources/templates/card-list.html index da49e8a..8f3737d 100644 --- a/src/main/resources/templates/card-list.html +++ b/src/main/resources/templates/card-list.html @@ -3,7 +3,7 @@ - Card List + Wallet: [[${group.name}]] @@ -19,7 +19,7 @@
-

Wallet

+

[[${group.name}]]