fix: 수강생 등록 시 바로 반영되도록 수정

This commit is contained in:
정기영 2024-08-09 17:54:32 +09:00
parent 9448d3e2ea
commit 189f786653

View File

@ -7,7 +7,7 @@ import styles from './LectureEnrollPage.module.css';
export default function LectureEnrollPage() {
const { lectureId } = useParams();
const { data } = useLectureEnroll(lectureId);
const { data, refetch } = useLectureEnroll(lectureId);
const [newStudents, setNewStudents] = useState([]);
const [students, setStudents] = useState([]);
@ -20,6 +20,7 @@ export default function LectureEnrollPage() {
const handleNewDelete = async (enrollId) => {
setNewStudents(newStudents.filter((student) => student.id !== enrollId));
refetch();
};
const handleDelete = async (enrollId) => {
@ -62,6 +63,3 @@ export default function LectureEnrollPage() {
</ArticleBoard>
);
}
//FIXME: .
// FIXME: HEADER .