nusmods
nusmods copied to clipboard
Use local venue data for development instead of prod data
Describe the bug
The venue json data is updated locally, but the localhost is using prod data
To Reproduce
Steps to reproduce the behavior:
- Change local data for any venue, launch localhost and find venue data is not updated
- Go to inspection on browser and see screenshot below
Expected behavior
Use local venue data instead of prod data
Screenshots
Im still quite new to this so correct me if I'm wrong but there are two seperate APIs for venues:
-
https://api.nusmods.com/v2/{academicYear}/semesters/{semester}/venues.json: used for the list of venues -
https://github.nusmods.com/venues: used for the roomName, floor and coordinates for each venue (which is the prod data being used in place of venue.json)
The feature to use local venue data (venues.json) is already implemented via the preferRepoVenues function in src/utils/debug.ts and allows you to force the application to use local data by appending the query string localVenue=1 to the URL but its not enabled by default
Hi, I will work on this.