Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

랭킹 api 연결하기 #579

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/src/api/ranking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { PassionUser, RankingPost } from '@type/ranking';

import { getFetch } from '@utils/fetch';

const BASE_URL = process.env.VOTOGETHER_MOCKING_URL;
const BASE_URL = process.env.VOTOGETHER_BASE_URL;

export const getUserRanking = async (isLoggedIn: boolean) => {
if (!isLoggedIn) return null;

return await getFetch<PassionUser>(`${BASE_URL}/members/me/ranking`);
return await getFetch<PassionUser>(`${BASE_URL}/members/me/ranking/passion`);
};

export const getPassionUserRanking = async () => {
Expand Down
10 changes: 9 additions & 1 deletion frontend/src/pages/Ranking/PassionUser/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ export default function PassionUserRanking() {
))}
</S.Tr>
{rankerList &&
rankerList.map(ranker => {
new Array(10).fill(0).map((_, index) => {
const ranker = rankerList[index] ?? {
ranking: '',
nickname: '',
postCount: '',
voteCount: '',
score: '',
};

const rankIcon = rankIconUrl[ranker.ranking] && (
<img src={rankIconUrl[ranker.ranking]} alt={ranker.ranking.toString()} />
);
Expand Down
Loading