Skip to content

Commit

Permalink
fix: admin일때만 리스트 보여지는 이슈 수정 (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamo-o authored Sep 30, 2024
1 parent 73c228e commit a6cc44a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions apps/admin/app/students/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ const StudentsPage = () => {
useEffect(() => {
const fetchData = async () => {
const adminStatus = await isAdmin();
if (adminStatus) {
const data = adminStatus
? await studyApi.getStudyList()
: await studyApi.getMyStudyList();

if (data && data.length && data[0]) {
setStudyList(data);
setSelectedStudy({ studyId: data[0].studyId, title: data[0].title });
}
const data = adminStatus
? await studyApi.getStudyList()
: await studyApi.getMyStudyList();

if (data && data.length && data[0]) {
setStudyList(data);
setSelectedStudy({ studyId: data[0].studyId, title: data[0].title });
}
};

Expand Down

0 comments on commit a6cc44a

Please sign in to comment.