nusmods icon indicating copy to clipboard operation
nusmods copied to clipboard

Use local venue data for development instead of prod data

Open xinyuwang-nus opened this issue 1 year ago • 2 comments

Describe the bug

The venue json data is updated locally, but the localhost is using prod data

To Reproduce

Steps to reproduce the behavior:

  1. Change local data for any venue, launch localhost and find venue data is not updated
  2. Go to inspection on browser and see screenshot below

Expected behavior

Use local venue data instead of prod data

Screenshots

Pasted Graphic 1 copy

xinyuwang-nus avatar Aug 21 '24 08:08 xinyuwang-nus

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

kaze-droid avatar Aug 22 '24 14:08 kaze-droid

Hi, I will work on this.

kavishsathia avatar Aug 28 '24 06:08 kavishsathia