Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> Previously, the endpoints for programs returned a comprehensive list of all `majors`, `minors`, and `specializations` without any filtering options. With this update, we have added the ability to query specific data by including optional parameters like `majorId` or `minorId`. This enhancement allows users to request only the relevant `specializations` associated with a particular `major` or `minor`, streamlining the data retrieval process and improving the overall user experience. ## Related Issue <!--- This project only accepts pull requests related to open issues --> <!--- If suggesting a new feature or change, please discuss it in an issue first --> <!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> <!--- Please link to the issue here: --> `/v2/rest/programs/specializations` should have some way to filter by major id - #96 ## Motivation and Context <!--- Why is this change required? What problem does it solve? --> Currently, the endpoint returns a list of all available specializations, which can be overwhelming and inefficient, especially for users seeking information about a specific `major`. By implementing this fix, users will be able to first retrieve the `major ID` through `/programs/majors`, and then query `/programs/specializations?majorID=BS-201` to get only the relevant specializations for a particular major, such as `Computer Science`. ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> Tested using local environment. ## Screenshots (if appropriate): REST: Majors: <img width="1064" alt="Screenshot 2025-01-27 at 21 25 04" src="https://github.com/user-attachments/assets/4c0fa642-f0a3-42be-9922-3a9aecab04f4" /> Minors: <img width="1070" alt="Screenshot 2025-01-27 at 21 25 17" src="https://github.com/user-attachments/assets/9fbe6128-00a0-4608-ae8a-d78d436a9cd4" /> Specializations: <img width="1242" alt="Screenshot 2025-01-27 at 21 25 34" src="https://github.com/user-attachments/assets/8c6282fe-9bd7-4979-9dac-a25e606a079a" /> GraphQL: Majors: <img width="902" alt="Screenshot 2025-01-27 at 23 14 26" src="https://github.com/user-attachments/assets/1f427cea-28be-4e91-809c-e6e74373643b" /> Minors: <img width="977" alt="Screenshot 2025-01-27 at 22 07 38" src="https://github.com/user-attachments/assets/d1a92e8b-5b2c-4beb-9772-feec67284c81" /> Specializations: <img width="1202" alt="Screenshot 2025-01-27 at 22 09 06" src="https://github.com/user-attachments/assets/58ab8cb2-444f-4ba9-bcbc-62709e851e9e" /> ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] My code involves a change to the database schema. - [ ] My code requires a change to the documentation. --------- Co-authored-by: Andrew Wang <[email protected]>
- Loading branch information