Skip to content

Commit dd25504

Browse files
committed
chore : URL 리디렉션 추가
1 parent cd47c7a commit dd25504

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

apps/Admission-LTS/src/pages/Landing.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,46 @@ export const Landing = () => {
7171
}, []);
7272

7373
const handleStartClick = () => {
74+
if (!scheduleData?.schedules) {
75+
toast.error('일정 정보를 불러오는 중입니다. 잠시 후 다시 시도해주세요.');
76+
return;
77+
}
78+
79+
const startDateSchedule = scheduleData.schedules.find(
80+
(s) => s.type === 'START_DATE'
81+
);
82+
const endDateSchedule = scheduleData.schedules.find(
83+
(s) => s.type === 'END_DATE'
84+
);
85+
86+
if (!startDateSchedule || !endDateSchedule) {
87+
toast.error('일정 정보를 확인할 수 없습니다.');
88+
return;
89+
}
90+
91+
const startDate = new Date(startDateSchedule.date);
92+
const endDate = new Date(endDateSchedule.date);
93+
const now = new Date();
94+
95+
// 접수 시작 전
96+
if (now < startDate) {
97+
toast.error('아직 접수 기간이 아닙니다.');
98+
setTimeout(() => {
99+
window.location.href = 'https://entrydsm.kr/';
100+
}, 1500);
101+
return;
102+
}
103+
104+
// 접수 마감 후
105+
if (now > endDate) {
106+
toast.error('접수 기간이 종료되었습니다.');
107+
setTimeout(() => {
108+
window.location.href = 'https://entrydsm.kr/';
109+
}, 1500);
110+
return;
111+
}
112+
113+
// 접수 기간 내
74114
navigate('/application-classification');
75115
};
76116

apps/entry-user/src/pages/MyPage.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ export const MyPage = () => {
148148
};
149149

150150
const handleApplicationSubmit = () => {
151+
if (!isApplicationAvailable) {
152+
toast.error('접수 기간이 아닙니다!');
153+
return;
154+
}
151155
window.open('https://admission.entrydsm.kr', '_blank');
152156
};
153157

0 commit comments

Comments
 (0)