Bug 23154 - Add pagination to /api/v1/checkouts
Summary: Add pagination to /api/v1/checkouts
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Web services (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Julian Maurice
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-19 09:16 UTC by Julian Maurice
Modified: 2020-06-04 20:32 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.03


Attachments
Bug 23154: Add pagination to /api/v1/checkouts (3.71 KB, patch)
2019-06-19 09:17 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 23154: Add pagination to /api/v1/checkouts (3.76 KB, patch)
2019-06-19 13:09 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 23154: Add pagination to /api/v1/checkouts (3.82 KB, patch)
2019-06-21 14:34 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2019-06-19 09:16:55 UTC
Allow to use _page and _per_page query parameters for /api/v1/checkouts
Comment 1 Julian Maurice 2019-06-19 09:17:29 UTC
Created attachment 90771 [details] [review]
Bug 23154: Add pagination to /api/v1/checkouts

Allow to use _page and _per_page query parameters for
/api/v1/checkouts
Also fix a timezone problem in t/db_dependent/api/v1/checkouts.t

Test plan:
1. With your favorite REST tester tool, or directly in the browser,
   fetch http://koha/api/v1/checkouts and check that you have results
2. Fetch /api/v1/checkouts?_per_page=1&page=1 and check that only the
   first result is returned. Check that response contains headers
   X-Total-Count and Link
3. Fetch /api/v1/checkouts?_per_page=1&page=2 and check that only the
   second result is returned. Check that response contains headers
   X-Total-Count and Link
4. prove t/db_dependent/api/v1/checkouts.t
Comment 2 Mark Tompsett 2019-06-19 13:09:31 UTC
Created attachment 90787 [details] [review]
Bug 23154: Add pagination to /api/v1/checkouts

Allow to use _page and _per_page query parameters for
/api/v1/checkouts
Also fix a timezone problem in t/db_dependent/api/v1/checkouts.t

Test plan:
1. With your favorite REST tester tool, or directly in the browser,
   fetch http://koha/api/v1/checkouts and check that you have results
2. Fetch /api/v1/checkouts?_per_page=1&_page=1 and check that only the
   first result is returned. Check that response contains headers
   X-Total-Count and Link
3. Fetch /api/v1/checkouts?_per_page=1&_page=2 and check that only the
   second result is returned. Check that response contains headers
   X-Total-Count and Link
4. prove t/db_dependent/api/v1/checkouts.t

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 3 Tomás Cohen Arazi 2019-06-21 14:34:18 UTC
Created attachment 90910 [details] [review]
Bug 23154: Add pagination to /api/v1/checkouts

Allow to use _page and _per_page query parameters for
/api/v1/checkouts
Also fix a timezone problem in t/db_dependent/api/v1/checkouts.t

Test plan:
1. With your favorite REST tester tool, or directly in the browser,
   fetch http://koha/api/v1/checkouts and check that you have results
2. Fetch /api/v1/checkouts?_per_page=1&_page=1 and check that only the
   first result is returned. Check that response contains headers
   X-Total-Count and Link
3. Fetch /api/v1/checkouts?_per_page=1&_page=2 and check that only the
   second result is returned. Check that response contains headers
   X-Total-Count and Link
4. prove t/db_dependent/api/v1/checkouts.t

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Martin Renvoize 2019-06-24 16:03:46 UTC
Nice work!

Pushed to master for 19.11.00
Comment 5 Fridolin Somers 2019-07-24 07:44:59 UTC
This may be useful to rewrite issues table in patron page with this API.
See also Bug 15219.
Comment 6 Fridolin Somers 2019-07-24 07:46:57 UTC
Pushed to 19.05.x for 19.05.03

Small enhancement, I choose to backport to stable.
Comment 7 Lucas Gass 2019-07-25 20:52:00 UTC
enhancement wont backport to 18.11.x