Skip to content
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

Add within_hours and within_days query options #60

Merged

Conversation

ebanner
Copy link
Contributor

@ebanner ebanner commented Jul 29, 2024

Addresses #57 (comment)

This PR adds within_hours and within_days query options to the API, so that clients may request events that are X hours out or X days out from now.

Notes

I was tempted to abstract the filtering logic into a partial function, but opted to duplicate the code for simplicity.

Also, the browser was requesting a favicon, which was messing with development. I put a check in at the top of the request loop to return, but I'm not sure if it's actually being handled property or not.

src/index.ts Fixed Show fixed Hide fixed
src/index.ts Fixed Show fixed Hide fixed
src/index.ts Fixed Show fixed Hide fixed
src/index.ts Fixed Show fixed Hide fixed
@ebanner ebanner marked this pull request as draft July 29, 2024 14:49
@ebanner ebanner force-pushed the add-withinHours-and-withinDays-query-options branch 2 times, most recently from 86af21e to dbf0f88 Compare July 29, 2024 14:55
@ebanner ebanner marked this pull request as ready for review July 29, 2024 14:56
@ebanner ebanner requested a review from chtzvt July 29, 2024 14:56
@ebanner ebanner force-pushed the add-withinHours-and-withinDays-query-options branch from cb39f93 to 189a31e Compare July 29, 2024 14:59
manuelosorio
manuelosorio previously approved these changes Jul 31, 2024
Copy link
Member

@manuelosorio manuelosorio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be working pretty well. This is a nice solution for days and hours filter.

@chtzvt
Copy link
Member

chtzvt commented Jul 31, 2024

Hey @ebanner!

I’ve been meaning to get to reviewing your PR and have some feedback. This week is packed for me, but I’ll do my best to knock the review out within the next day or so.

Copy link
Contributor

@iBotPeaches iBotPeaches left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking a look at this @ebanner

I think you probably want these changes in the filterEventData from the Util library class. It handles the params and filtering the data down, which these within_hours=x and within_days=x match.

This appears to work outside of that filtering the data down further, which seems out of place given the param filtering is inside that util.

@ebanner ebanner marked this pull request as draft August 23, 2024 16:15
@ebanner
Copy link
Contributor Author

ebanner commented Aug 23, 2024

Ah, good call @iBotPeaches! I guess I missed that function.

I moved it over 👍

@ebanner ebanner marked this pull request as ready for review August 23, 2024 16:19
@ebanner ebanner force-pushed the add-withinHours-and-withinDays-query-options branch 2 times, most recently from ede8095 to 30e4415 Compare August 23, 2024 16:25
Also add dummy /favicon.ico route
@ebanner ebanner force-pushed the add-withinHours-and-withinDays-query-options branch from 30e4415 to 7398dcc Compare August 23, 2024 16:26
@chtzvt chtzvt merged commit 616ce07 into TampaDevs:master Aug 24, 2024
4 checks passed
@chtzvt
Copy link
Member

chtzvt commented Aug 24, 2024

@ebanner Great work on this-- stoked to see it merged!

Shoutout to @iBotPeaches also for taking point on code review ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants