-
-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: Filter future seasons out from the data sent to the stats page #163
Labels
enhancement
New feature or request
Comments
itsalaidbacklife
added
enhancement
New feature or request
hacktoberfest
This issue welcomes contributions for Hacktoberfest.
labels
Oct 14, 2022
itsalaidbacklife
removed
the
hacktoberfest
This issue welcomes contributions for Hacktoberfest.
label
Nov 1, 2022
Can I work on this @itsalaidbacklife |
@P-DR0ZD Yes please do! Please feel free to ask any questions you have here or in discord |
4 tasks
itsalaidbacklife
added a commit
to P-DR0ZD/cuttle
that referenced
this issue
Nov 11, 2022
P-DR0ZD
added a commit
to P-DR0ZD/cuttle
that referenced
this issue
Nov 12, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature Summary
Currently the stats page displays all the available Seasons that are listed in the database. We should the backend endpoint that services the stats page to filter out the future seasons (start time is after current time).
Detailed Description
Currently if seasons are added to the database (e.g. Spades 2023) for a future start time, they will be displayed in the Stats page, and the latest-starting one will be pre-selected in the dropdown at the top of the page like so:
This is unideal from a maintenance standpoint because it means we need to wait until the end of the previous season to add the new one to the database. It would be much more efficient to have the backend endpoint that generates the stats payload to filter out the seasons that haven't started yet. That way we could add future seasons in one big batch without worrying about waiting until just before they start.
To do this we should update
api/helpers/get-seasons-without-rankings.js
which is a helper used to fetch the seasons. In that function, the query for all the seasons should receive an additionalwhere
clause to filter down to the seasons that are only have a start time that is less than the current time. See line 7 of that function:The where clause can be set according to the sails docs on querying and the current time should be calculated using
dayjs().valueOf()
(docs) which should compute the current time in millisecondsThe text was updated successfully, but these errors were encountered: