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

Search for a range of dates #51

Merged
merged 7 commits into from
Apr 24, 2024
Merged

Search for a range of dates #51

merged 7 commits into from
Apr 24, 2024

Conversation

augustus-thomas
Copy link
Collaborator

Closes Issue #40
This refactor required changes to four files:

  • API.md : the "Additional Feature 1: Search notes by note content" section now includes mention of an optional "start" and "end" field for the body sent to the /notes/search endpoint
  • app.py : search endpoint now supports start and end payload key values, which contain (you guessed it) the start and end dates for the search windows for both modified and created dates searches. Notice that we only check for the values of these keys if the search_field is one of the dates fields, otherwise we don't read it at all
  • apiCalls.py : json for the calls to the search endpoint need to be variable now. if we see that the key is modified or created date, we need to include the start and end values. we do that by setting start and end equal to None type by default, so that they don't need to be included by the caller on the frontend, but can be.
  • frontend.py : now we need to ask the user for two values whenever they run the modified and created date case: the start and end date by which to search.

Copy link
Collaborator

@nherman71 nherman71 left a comment

Choose a reason for hiding this comment

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

LGTM, generic comment to show comprehension goes here.
(I did fully review this line by line)

apiCalls.py Show resolved Hide resolved
Copy link
Owner

Choose a reason for hiding this comment

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

Also, I am sure the empty field in the line below serves a purpose. But could you briefly explain the empty field at the start of class because I am not sure what that purpose is.
api_response = apiCalls.searchNotes('created_date', "", desired_response, start, end)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good catch, didn't consider this

augustus-thomas and others added 2 commits April 24, 2024 11:33
this resolves Chris' desire for a default end as today and default start as sometime in the distant past
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.

3 participants