Skip to content
Merged
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
14 changes: 8 additions & 6 deletions src/pages/StudyEnrollment/components/StudyEnrollmentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ export function StudyEnrollmentForm({ currentSemesterInfo, myStudyEnrollment }:
}, [myStudyEnrollment, currentSemesterInfo]);

const handleClickNextStep = () => {
if (currentStep < TOTAL_STEPS) {
if (currentStep === 2 && enrollmentData.courses.length === 0) {
toast('최소 하나의 수업을 추가해주세요.');
return;
}
setCurrentStep((prev) => prev + 1);
if (currentStep >= TOTAL_STEPS) return;

const COURSE_STEP = 2;
if (currentStep === COURSE_STEP && enrollmentData.courses.length === 0) {
toast('최소 하나의 수업을 추가해주세요.');
return;
}

setCurrentStep((prev) => prev + 1);
};

const handleClickPrevStep = () => {
Expand Down