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

Cast filter values to booleans on Content API #2640

Merged
merged 2 commits into from
Oct 13, 2020
Merged

Cast filter values to booleans on Content API #2640

merged 2 commits into from
Oct 13, 2020

Conversation

duncanmcclean
Copy link
Member

This PR fixes #1736.

Previously, when using a filter in the Content API, like the one in the URL below, true would be string which wouldn't work for the check (true !== 'true'), where as now, it will be cast to a boolean and the check will work.

http://statamic.test/api/collections/pages/entries?filter[published]=true

@jasonvarga jasonvarga merged commit 16865fc into statamic:master Oct 13, 2020
@jasonvarga
Copy link
Member

filter[thanks]=true

@duncanmcclean
Copy link
Member Author

filter[you_are_very_much]=welcome

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.

API filter checking boolean true against string "true"
2 participants