Skip to content

[Bug]: V1 POST document/index pagination problem #3199

@damian-molinski

Description

@damian-molinski

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When calling v1 index endpoint, with empty filtering and page 0

curl --location 'https://app.dev.projectcatalyst.io/api/gateway/v1/document/index?page=0&limit=200' \
--header 'Content-Type: application/json' \
--data '{
}'

response is a

{
    "docs": [
    ...
    ],
    "page": {
        "limit": 200,
        "page": 0,
        "remaining": 12
    }
}

Notice that page object says "remaining": 12

but when i want to query page 1 with

curl --location 'https://app.dev.projectcatalyst.io/api/gateway/v1/document/index?page=1&limit=200' \
--header 'Content-Type: application/json' \
--data '{
}'

response is 404 Not Found.

Expected Behavior

  1. number of docs inside array should respect limit parameter and be consistent with remaining part.
  2. when calling page: 1 response should be empty docs list instead of 404 Not Found

Project

Backend

Version

Discovered after #3149 was merged into main

What operating system are you seeing the problem on?

macOS

What browsers are you seeing the problem on?

Chrome

Relevant log output

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

in triagePresently being triaged by the triage teamsquad: gatekeepersCatalyst App Backend, System Development & Integration TeamwontfixThis will not be worked on

Type

Projects

Status

👀 In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions