Skip to content

Commit 9e9ffde

Browse files
Merge pull request #110 from sparcs-kaist/fix-syllabus-url
Fix lectureUtil.ts
2 parents 81115c1 + 10782e3 commit 9e9ffde

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/utils/lectureUtils.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,13 @@ export const getExamFullStr = (lecture: Lecture) => {
124124

125125
export const getColorNumber = (lecture: Lecture) => (lecture.course % 16) + 1;
126126

127-
export const getSyllabusUrl = (lecture: Lecture) =>
128-
`https://cais.kaist.ac.kr/syllabusInfo?year=${lecture.year}&term=${lecture.semester}&subject_no=${lecture.code}&lecture_class=${lecture.class_no}&dept_id=${lecture.department}`;
127+
export const getSyllabusUrl = (lecture: Lecture) => {
128+
const payload = {
129+
syy: String(lecture.year),
130+
smtDivCd: String(lecture.semester),
131+
subjtCd: lecture.old_code,
132+
syllabusOpenYn: '0',
133+
};
134+
const encodedLecture = btoa(JSON.stringify(payload));
135+
return `https://erp.kaist.ac.kr/com/lgin/SsoCtr/initExtPageWork.do?link=estblSubjt&params=${encodedLecture}`;
136+
};

0 commit comments

Comments
 (0)