Skip to content

Commit

Permalink
fix: entity mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongh00 committed Feb 4, 2024
1 parent 01c848a commit 3576df2
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.congress.coremodule.mypage.domain.service;

import com.congress.coremodule.law.domain.entity.Law;
import com.congress.coremodule.law.domain.entity.LegislateLaw;
import com.congress.coremodule.law.domain.repository.LawRepository;
import com.congress.coremodule.member.domain.entity.Member;
import com.congress.coremodule.member.domain.repository.MemberRepository;
Expand Down Expand Up @@ -46,8 +47,12 @@ public List<Long> getLawIds() {

public List<Long> getLegislatorIds(Long memberId) {

List<LegislateVote> vote = legislateVoteRepository.findLegislateVotesByMemberId(memberId);
return vote.stream().map(LegislateVote::getId).collect(Collectors.toList());
return legislateVoteRepository
.findLegislateVotesByMemberId(memberId)
.stream()
.map(LegislateVote::getLegislateLaw)
.map(LegislateLaw::getId)
.toList();
}

public List<String> getHashTagNames(Long memberId) {
Expand Down

0 comments on commit 3576df2

Please sign in to comment.