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 id to filter fields for children-api endpoint #625

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

MrApplejuice
Copy link
Contributor

@MrApplejuice MrApplejuice commented Apr 11, 2023

Background

The api endpoint http://localhost:8888/api/children/ right now uses the slug of a child to do a detail query, while most filter-options for activities (tummy-time, use the child-id to implement filtering.

I have encountered a bug in the Android App I am developing for which it would be handy to do a quick check for the existence of a child. It is kind of awkward to have to use the slug for this while I use a child-id for all other types of queries.

Solution

To allow for a quick "exists"-check against the database, I added the "id" flag to the filterset-fields to allow http://localhost:8888/api/children/?id=xxx which will solve this issue. Less awkward than traversing a potentially super-long list of child-items just to find the one you are looking for...

@coveralls
Copy link

Coverage Status

Coverage: 99.018% (-0.04%) from 99.055% when pulling e613f4d on MrApplejuice:add-child-id-to-filter-fields into 77d4ba1 on babybuddy:master.

@cdubz cdubz merged commit 5b07631 into babybuddy:master Apr 11, 2023
11 checks passed
@cdubz cdubz added the enhancement Feature requests or improvements to existing functionality label Apr 11, 2023
@cdubz cdubz added this to the 1.16.0 milestone Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests or improvements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants