Skip to content

Commit

Permalink
fix: 지역구 나오지 않는 문제 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
limkhl committed May 24, 2024
1 parent 73f27c7 commit e01a06a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/Result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ const Result = () => {

async function joinPersonalInfo(candidates: any) {
return Promise.all(candidates.map(async (candidate: any) => {
const { data: candidateInfo } = await client().get(`/api/candidates/${candidate.id}`)
const candidateInfo = await fetch(`/candidates/${candidate.id}.json`).then((res) => res.json())
const { data: { elected } } = await client().get(`/api/candidates/${candidate.id}`)
const { choice, id } = candidate
return { candidate: candidateInfo, choice, id }
return { candidate: candidateInfo, choice, id, elected }
}))
}

const electedAgrees = agrees.filter(e => e.candidate.elected)
const electedAgrees = agrees.filter(e => e.elected)

React.useEffect(() => {
fetchResponses()
Expand Down

0 comments on commit e01a06a

Please sign in to comment.