Skip to content

Commit

Permalink
fix: 사이드바에서 어드민 api 호출 버그 픽스, 사용자 api로 교체
Browse files Browse the repository at this point in the history
  • Loading branch information
HiimKwak committed Nov 28, 2023
1 parent 0c82f8d commit 7d41dbe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/common/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import Link from 'next/link';
import { useEffect, useState } from 'react';

import { getAllLeaguesWithAuth } from '@/api/admin/league';
import { LeagueType } from '@/types/admin/league';
import { getAllLeagues } from '@/api/league';
import { LeagueType } from '@/types/league';

type SidebarProps = {
isSidebarOpen: boolean;
Expand All @@ -15,12 +15,12 @@ export default function Sidebar({
onClickSidebar,
}: SidebarProps) {
const [menuContent, setMenuContent] = useState<LeagueType[]>([
{ name: '전체', leagueId: 0, startAt: '', endAt: '' },
{ name: '전체', leagueId: 0 },
]);

useEffect(() => {
const getLeagueData = async () => {
const res = await getAllLeaguesWithAuth();
const res = await getAllLeagues();

setMenuContent(prev => [...prev, ...res]);
};
Expand Down

0 comments on commit 7d41dbe

Please sign in to comment.