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 additional filters to page list endpoints #1622

Merged
merged 2 commits into from Mar 22, 2024

Conversation

tw4l
Copy link
Contributor

@tw4l tw4l commented Mar 21, 2024

Fixes #1617

Filters added:

  • reviewed: filter by page has approval or at least one note (true) or neither (false)
  • approved: filter by approval value (accepts list of strings, comma-separated, each of which are coerced into True, False, or None, or ignored if they are invalid values)
  • hasNotes: filter by has at least one note (true) or not (false)

Tests have also been added to ensure that results are as expected.

- reviewed: filter by page has approval or at least one note
- approved: filter by approval value
- anyApproval: filter by approval value is bool (true) or None (false)
- hasNotes: filter by true or false
Strings in approved list are coerced into bools or None values as
appropriate, with other values ignored.
@tw4l tw4l requested review from ikreymer and SuaYoo March 21, 2024 23:02
Copy link
Collaborator

@SuaYoo SuaYoo left a comment

Choose a reason for hiding this comment

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

Didn't review code, but tested locally and working well!

@ikreymer
Copy link
Member

Looks good! We could potentially doing it the pydantic/fastapi way by parsing a comma-separated list into a list, as suggested in: tiangolo/fastapi#50 but this should be good for now!

@ikreymer ikreymer merged commit e9895e7 into main Mar 22, 2024
4 checks passed
@ikreymer ikreymer deleted the issue-1617-reviewed-pages-filter branch March 22, 2024 04:33
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.

[Feature]: Additional filtering for pages
3 participants