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

List number of resources & resources per page in API response #54

Open
LMBishop opened this issue Jun 30, 2021 · 1 comment · May be fixed by #70
Open

List number of resources & resources per page in API response #54

LMBishop opened this issue Jun 30, 2021 · 1 comment · May be fixed by #70
Assignees
Labels
awaiting-pr enhancement New feature or request

Comments

@LMBishop
Copy link

When sending a request to paginated endpoints such as listResources and getResourcesByAuthor, there is no way to know how many pages of resources there are without sending another request with a different page number and expecting an empty response (indicating a blank page).

This could be fixed by returning the total number of resources, and the number of resources per page (should this change in the future) in the API response.

Example GET index.php?action=getResourcesByAuthor&id=138900&page=1:

{
  "meta": {
    "total_items": "20",
    "items_per_page": "10"
  },
  "items": [
    {
      "id": "23696",
      "title": "Quests [1.8-1.17] | Set up goals for players",
      "tag": "Allow your players to do quests in return for rewards",
      "etc": "..."
    }
  ]
}
@jacobsandersen
Copy link
Collaborator

sorry for the delay. #70 will add this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-pr enhancement New feature or request
Projects
None yet
3 participants
@LMBishop @jacobsandersen and others