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

Pagination not working on related endpoint #25666

Closed
erickgonzalez opened this issue Jul 31, 2023 · 2 comments · Fixed by #25685
Closed

Pagination not working on related endpoint #25666

erickgonzalez opened this issue Jul 31, 2023 · 2 comments · Fixed by #25685
Assignees
Labels

Comments

@erickgonzalez
Copy link
Contributor

erickgonzalez commented Jul 31, 2023

Parent Issue

No response

Problem Statement

When using offset and limit with this endpoint /api/v1/content/related no results are returned.

Steps to Reproduce

  1. Create a Content Type with a Title and a Relationship field (named Devices to the Device CT).
  2. Create a content of the created CT, and relate all 3 devices.
  3. Make the following Curl call:
curl --location 'http://localhost:8080/api/v1/content/related' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhcGkyY2MwODZlYS1jMWUyLTQ5N2ItODY3Yy1lMDNhOGQyNGVkM2MiLCJ4bW9kIjoxNjc5OTQyMTQ5MDAwLCJuYmYiOjE2Nzk5NDIxNDksImlzcyI6IjE5ZDY3YmJhMmMiLCJsYWJlbCI6InBwIiwiZXhwIjoxNzc0NTkxMjAwLCJpYXQiOjE2Nzk5NDIxNDksImp0aSI6IjUyZjhkOWMyLWZkZjItNDYzMy1hYjlmLTY3OTg5MWExMzhlNCJ9.oyGBU6MxIHHDAmYmu4bbA6Y1baTUpF6vOCPro7E9WJA' \
--data '{
   "identifier":"6e2529b080eecaf689de9aa19fa1361d",
   "fieldVariable":"devices"
}'

All 3 devices should be returned.
4- Now let's add limit and offset to Curl call:

curl --location 'http://localhost:8080/api/v1/content/related' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhcGkyY2MwODZlYS1jMWUyLTQ5N2ItODY3Yy1lMDNhOGQyNGVkM2MiLCJ4bW9kIjoxNjc5OTQyMTQ5MDAwLCJuYmYiOjE2Nzk5NDIxNDksImlzcyI6IjE5ZDY3YmJhMmMiLCJsYWJlbCI6InBwIiwiZXhwIjoxNzc0NTkxMjAwLCJpYXQiOjE2Nzk5NDIxNDksImp0aSI6IjUyZjhkOWMyLWZkZjItNDYzMy1hYjlmLTY3OTg5MWExMzhlNCJ9.oyGBU6MxIHHDAmYmu4bbA6Y1baTUpF6vOCPro7E9WJA' \
--data '{
   "identifier":"6e2529b080eecaf689de9aa19fa1361d",
   "fieldVariable":"devices",
   "limit":1,
   "offset": 2
}'

Nothing is returned, but the second device should be returned.

Acceptance Criteria

when using offset and limit should return results if they're available.

dotCMS Version

22.03 +

Proposed Objective

Customer Support

Proposed Priority

Priority 2 - Important

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

https://dotcms.zendesk.com/agent/tickets/112490

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

@erickgonzalez erickgonzalez self-assigned this Jul 31, 2023
@erickgonzalez erickgonzalez linked a pull request Aug 1, 2023 that will close this issue
erickgonzalez added a commit that referenced this issue Aug 7, 2023
* #25666 limit of the sublist should be limit+offset

* #25666 sum offset and limit, new test
@erickgonzalez erickgonzalez reopened this Aug 7, 2023
@bryanboza
Copy link
Member

bryanboza commented Aug 9, 2023

.

@josemejias11
Copy link

Approved QA - Tested on master_pre-release_23.08_8d30d6e // Docker // macOS 13.0 // FF v113.0

erickgonzalez added a commit that referenced this issue Aug 22, 2023
@erickgonzalez erickgonzalez added the Release : 22.03.9 Included in LTS patch release 22.03.9 label Aug 22, 2023
erickgonzalez added a commit that referenced this issue Aug 31, 2023
@erickgonzalez erickgonzalez added Release : 23.01.6 Included in LTS patch release 23.01.6 and removed Next LTS Release labels Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants