Skip to content

Commit

Permalink
Merge pull request #115 from sseooh/walletList/weekly/11
Browse files Browse the repository at this point in the history
fix: group 프론트 수정 및 그룹 정보 표시 수정
  • Loading branch information
sseooh authored Nov 15, 2024
2 parents fccb7df + 92c4d3f commit c3b2305
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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")
Expand Down Expand Up @@ -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<CardResponseDto> cards = cardService.getCardsByGroup(groupId, oauthMemberDetails.getMember());
model.addAttribute("cards", cards);
model.addAttribute("group", groupRepository.findById(groupId).get());
return "card-list";
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/templates/card-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Card List</title>
<title>Wallet: [[${group.name}]]</title>

<!-- CSS -->
<link rel="stylesheet" th:href="@{/css/global.css}">
Expand All @@ -19,7 +19,7 @@
<body>
<div class="container">
<div class="header">
<h2 class="title">Wallet</h2>
<h2 class="title">[[${group.name}]]</h2>
</div>

<div class="card-list">
Expand Down

0 comments on commit c3b2305

Please sign in to comment.