Update API Calls - #69
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request updates API calls to align with a new backend API structure and improves tag rendering in course components. The main changes involve renaming course fields (dept → subj_code, code_num string → number), changing list fields from comma-separated strings to arrays (attr_list, sem_list), and enhancing the Tag component to support separate background and text colors with improved color schemes.
Key Changes:
- Updated
CourseTypeinterface to usesubj_codeand numericcode_num, withattr_listandsem_listas string arrays - Changed API endpoint from
/course/filter/values/departmentsto/course/filter/values/subjects - Enhanced Tag component to accept both
bgcolorandcolorprops for more flexible styling
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/types/interfaces/Course.interface.ts | Updated CourseType interface: renamed dept to subj_code, changed code_num from string to number, converted attr_list and sem_list from strings to string arrays |
| src/context/FilterProvider.tsx | Updated API endpoint from "departments" to "subjects" and removed trailing commas |
| src/context/CourseWorkspaceProvider.tsx | Added semesterID field to default semester object |
| src/components/PlannerComponents/RightClickContext.tsx | Updated course display format to use hyphen between subject code and number (e.g., "CS-101") |
| src/components/Course/ToolboxCourse.tsx | Updated course display format to use hyphenated format |
| src/components/Course/PlannerCourse.tsx | Updated course display format to use hyphenated format |
| src/components/Course/CatalogCourse/Tag.tsx | Added bgcolor prop and made text color configurable via color prop |
| src/components/Course/CatalogCourse.tsx | Updated to use array mapping for tags instead of string splitting, with distinct color schemes for attributes and semesters |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request mainly updates the api calls to reflect the updated api.
Tag rendering improvements:
Tagcomponent and its usage to accept both background and text color, and to render tags from arrays instead of splitting strings. Improved tag color schemes for attributes and semesters. (src/components/Course/CatalogCourse/Tag.tsx,src/components/Course/CatalogCourse.tsx)