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}]]