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

API: Add featured filter option to posts.browse #5152

Closed
ErisDS opened this issue Apr 16, 2015 · 4 comments · Fixed by #5223
Closed

API: Add featured filter option to posts.browse #5152

ErisDS opened this issue Apr 16, 2015 · 4 comments · Fixed by #5223
Labels
affects:api Affects the Ghost API

Comments

@ErisDS
Copy link
Member

ErisDS commented Apr 16, 2015

Currently the api.posts.browse endpoint takes the following options:

page, limit, status, staticPages, tag

There is an open issue to swap page for offset

And another issue to swap staticPages for page as well as add generally better support for querying pages.

It would also be good to be able to filter posts by whether or not they are featured:

api.posts.browse({featured: true}) or api.posts.browse({featured: false})

Making this work involves adding this as an allowed option in the model.

@ErisDS ErisDS added the affects:api Affects the Ghost API label Apr 16, 2015
@edsadr
Copy link
Contributor

edsadr commented Apr 16, 2015

Taking care of this one :)

@ErisDS
Copy link
Member Author

ErisDS commented Apr 22, 2015

@edsadr let us know if you need a hand - you know where to find us :)

@edsadr
Copy link
Contributor

edsadr commented Apr 22, 2015

@ErisDS changes are done but... just one test failing.. I will work on it today to send the PR ... and we will have to discuss some stuff but lets do it after push the code

edsadr added a commit to edsadr/Ghost that referenced this issue Apr 22, 2015
    Closes TryGhost#5152, TryGhost#5093, TryGhost#5151
    - Adds `featured` filter option to posts.browse method modifying the model to take it too
    - Implements offset pagination method to posts.browse method modifying the model to work with it too but still supporting the `page` parameter
    - Removes `staticPages` parameter in options filter to allow using the `page` parameter with options `all` `true` or `false
@edsadr
Copy link
Contributor

edsadr commented Apr 22, 2015

@ErisDS here is what I would like to propose, with #5093 you are requesting to stop using page with an integer to get a page, but I implemented to support the current format and also to support the offset/limit format pager, however if page is a boolean then it will get just static pages replacing staticPages parameter.

I wanted to do it this way as I think is a way more flexible and will also support the new offset limit approach ... if you guys don't like this then I will change to any other approach you decide =)

Let me know

edsadr added a commit to edsadr/Ghost that referenced this issue May 5, 2015
- Adds `featured` filter option to posts.browse method modifying the model to take it too
edsadr added a commit to edsadr/Ghost that referenced this issue May 13, 2015
- Adds `featured` filter option to posts.browse method modifying the model to take it too
edsadr added a commit to edsadr/Ghost that referenced this issue May 13, 2015
- Adds `featured` filter option to posts.browse method modifying the model to take it too
edsadr added a commit to edsadr/Ghost that referenced this issue May 13, 2015
Closes TryGhost#5152
- Adds `featured` filter option to posts.browse method modifying the model to take it too
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:api Affects the Ghost API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants