Skip to content

Commit

Permalink
fix: 투표순대로 정렬
Browse files Browse the repository at this point in the history
  • Loading branch information
ddhelop committed Jun 28, 2024
1 parent c861aaa commit 913b11f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/DemoDayVote/DemoDayVoteReult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export default function DemoDayVoteResult() {
try {
const response = await voteResult(accessToken);
const result: VoteResult[] = await response.json();
// 결과를 voteCount 순으로 정렬
result.sort((a, b) => parseInt(b.voteCount) - parseInt(a.voteCount));

setVoteResults(result);
} catch (error) {
Expand All @@ -31,7 +33,6 @@ export default function DemoDayVoteResult() {
<div className="flex w-full flex-col items-center justify-center bg-BG-black text-white">
<main className="flex w-full flex-grow flex-col items-center justify-center px-12 pb-20">
<h1 className="mb-8 text-center text-3xl font-bold">데모데이 투표 현황</h1>

<div className="flex w-full gap-12">
<div className="flex w-full flex-col gap-6">
{voteResults.map((result, index) => (
Expand Down

0 comments on commit 913b11f

Please sign in to comment.