Bug 23154

Summary: Add pagination to /api/v1/checkouts
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: Web servicesAssignee: Julian Maurice <julian.maurice>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, lucas, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15219
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
Bug 23154: Add pagination to /api/v1/checkouts
Bug 23154: Add pagination to /api/v1/checkouts

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