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
12 changes: 10 additions & 2 deletions src/utils/lectureUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,13 @@ export const getExamFullStr = (lecture: Lecture) => {

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

export const getSyllabusUrl = (lecture: Lecture) =>
`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}`;
export const getSyllabusUrl = (lecture: Lecture) => {
const payload = {
syy: String(lecture.year),
smtDivCd: String(lecture.semester),
subjtCd: lecture.old_code,
Copy link

Copilot AI Aug 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code references 'lecture.old_code' but the original implementation used 'lecture.code'. Verify that 'old_code' property exists on the Lecture type and contains the correct subject code for the new ERP system.

Suggested change
subjtCd: lecture.old_code,
subjtCd: lecture.old_code ?? lecture.code,

Copilot uses AI. Check for mistakes.
syllabusOpenYn: '0',
};
const encodedLecture = btoa(JSON.stringify(payload));
Copy link

Copilot AI Aug 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using btoa() for encoding could fail if the JSON string contains non-ASCII characters. Consider using encodeURIComponent() or a more robust base64 encoding method to handle international characters in lecture data.

Suggested change
const encodedLecture = btoa(JSON.stringify(payload));
const encodedLecture = btoa(unescape(encodeURIComponent(JSON.stringify(payload))));

Copilot uses AI. Check for mistakes.
return `https://erp.kaist.ac.kr/com/lgin/SsoCtr/initExtPageWork.do?link=estblSubjt&params=${encodedLecture}`;
};
Loading