pecan icon indicating copy to clipboard operation
pecan copied to clipboard

Fixed pagination error in REST API's

Open koolgax99 opened this issue 3 years ago • 1 comments

Description

  • Before, the new_page and prev_page field in the inputs API consisted links of /api/workflows. Now it is changed to /api/inputs.
  • The offset param was set to NA50 in the next_page if it wasn't defined in the start for runs, workflows and inputs API.

Before

  • For /api/inputs/ the response was: "next_page": "http://api.pecan.localhost:8000/api/workflows/NA50&limit=50"
  • Similarly, For /api/workflows/ the response was: "next_page": "http://api.pecan.localhost:8000/api/workflows/NA50&limit=50"
  • For /api/runs/ the response was: "next_page": "http://api.pecan.localhost:8000/api/runs/NA50&limit=50"

After

  • For /api/inputs/ the response now is "next_page": "http://api.pecan.localhost:8000/api/inputs/?offset=50&limit=50"
  • For /api/workflows/ the response now is "next_page": "http://api.pecan.localhost:8000/api/workflows/?offset=50&limit=50"
  • For /api/runs/ the response now is "next_page": "http://api.pecan.localhost:8000/api/runs/?offset=50&limit=50"

Review Time Estimate

  • [x] Immediately
  • [ ] Within one week
  • [ ] When possible

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [ ] My change requires a change to the documentation.
  • [ ] My name is in the list of CITATION.cff
  • [ ] I have updated the CHANGELOG.md.
  • [ ] I have updated the documentation accordingly.
  • [x] I have read the CONTRIBUTING document.
  • [ ] I have added tests to cover my changes.
  • [x] All new and existing tests passed.

koolgax99 avatar Jul 05 '22 18:07 koolgax99

@dlebauer sir i have added the changelog!

koolgax99 avatar Jul 07 '22 12:07 koolgax99