Skip to content

Commit

Permalink
chore: study -> selectedStudy 네이밍 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
hamo-o committed Sep 8, 2024
1 parent cae3796 commit 82c85b4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/admin/app/students/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { studyAtom } from "./_contexts/StudyProvider";

const StudentsPage = () => {
const [studyList, setStudyList] = useState<StudyListApiResponseDto[]>();
const [study, setStudy] = useAtom(studyAtom);
const [selectedStudy, setSelectedStudy] = useAtom(studyAtom);

useEffect(() => {
const fetchData = async () => {
Expand All @@ -27,15 +27,15 @@ const StudentsPage = () => {

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

fetchData();
}, [setStudy]);
}, [setSelectedStudy]);

const student = useFetchStudents(study);
const student = useFetchStudents(selectedStudy);
if (!studyList) return <Text>담당한 스터디가 없어요.</Text>;

return (
Expand Down

0 comments on commit 82c85b4

Please sign in to comment.