Skip to content

Paginate all the things #2896

@sebgie

Description

@sebgie

In our current implementation Ghost returns inconsistent results for GET requests that return more than one object (e.g. /ghost/api/v0.1/tags/). users, tags, settings and soon apps return all elements from the database. posts returns a paginated result with meta information. This behavior is inconsistent and should be changed to return a paginated result for all API calls that return multiple objects.

The post model has findAll() and findPage() methods atm. findAll() returns all existing post objects and is only used for deleting all content. We would like to keep the use case but remove findAll() by allowing all to be passed as limit parameter.

Default pagination options:

  • page: 1
  • limit: 15 (allows all)

I think it is worth investigating if it is possible to implement a generic findPage() method in base.js and override it for models with special requirements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions