icssc / peterportal-public-api

API that provides easy-access to UC Irvine data such as: courses, professors, grade distribution, schedule of classes, and more
https://api.peterportal.org/
MIT License
23 stars 10 forks source link

Add endpoint for the current week. #121

Closed ramanxg closed 2 years ago

ramanxg commented 2 years ago

It would be nice to show the current week in AntAlmanac as it does in PeterPortal Core. Let's move this functionality over to the API, and serve it here.

In PeterPortal Core, this is the code for getting the current week. https://github.com/icssc-projects/peterportal-client/blob/master/api/src/helpers/week.ts

This endpoint references a MongoDB instance which stores a cached value of the week, so it doesn't always make a request to UCI.

For now, we can comment out the part for caching the week.

TODO:

ramanxg commented 2 years ago

This might have to be changed, but rather than only using today's date, it should also be able to take in a date as a parameter. and use that. (default can be today's date).