Conversation
Fix lectureUtil.ts
|
Caution Review failedThe pull request is closed. WalkthroughThe implementation of the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant lectureUtils.ts
Caller->>lectureUtils.ts: getSyllabusUrl(lecture)
lectureUtils.ts->>lectureUtils.ts: Construct JSON payload from lecture fields
lectureUtils.ts->>lectureUtils.ts: Base64-encode JSON payload
lectureUtils.ts->>Caller: Return URL with encoded params
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Pull Request Overview
This hotfix updates the syllabus URL generation logic to use a new KAIST ERP system endpoint instead of the old CAIS system. The change modifies how syllabus links are constructed by switching from URL parameters to a base64-encoded JSON payload format.
- Replaced the old CAIS syllabus URL format with a new ERP system endpoint
- Changed from URL query parameters to a base64-encoded JSON payload structure
- Updated field mappings to match the new API requirements
| const payload = { | ||
| syy: String(lecture.year), | ||
| smtDivCd: String(lecture.semester), | ||
| subjtCd: lecture.old_code, |
There was a problem hiding this comment.
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.
| subjtCd: lecture.old_code, | |
| subjtCd: lecture.old_code ?? lecture.code, |
| subjtCd: lecture.old_code, | ||
| syllabusOpenYn: '0', | ||
| }; | ||
| const encodedLecture = btoa(JSON.stringify(payload)); |
There was a problem hiding this comment.
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.
| const encodedLecture = btoa(JSON.stringify(payload)); | |
| const encodedLecture = btoa(unescape(encodeURIComponent(JSON.stringify(payload)))); |
Summary by CodeRabbit
New Features
Bug Fixes