[Bug 36562] New: Add GET endpoint for counting checkouts
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36562 Bug ID: 36562 Summary: Add GET endpoint for counting checkouts Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: alex.arnaud@biblibre.com CC: tomascohen@gmail.com Currently we can paginate checkouts using REST API. It could be useful to have the count only to prepare showing a paginated result. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36562 --- Comment #1 from Alex Arnaud <alex.arnaud@biblibre.com> --- Created attachment 164578 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164578&action=edit Bug 36562: [REST API] Add GET endpoint for counting checkouts Test plan: curl -v -s -u koha:koha --request GET http://kohadev.local/api/v1/checkouts/count?patron_id=1 Available parameters and permissions are the same than for listing checkouts -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36562 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36562 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36562 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |WORKSFORME CC| |jonathan.druart@gmail.com Status|Needs Signoff |RESOLVED --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- The way to do this, is to perform a: curl -v -s -u koha:koha --request GET http://kohadev.local/api/v1/checkouts?q={"patron_id":1}&_per_page=1&_page_1 and read the X-Total-Count header from the response. I was about to point you to the http-client.js library, but it seems the .count method hasn't been ported from the Vue counterpart. Look at the Vue one for more information. Adding Jonathan, maybe he can comment on why that's not there. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36562 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Another option would be to add - +strings + - checkouts+count - extended_attributes to the 'x-koha-embed' definition for GET /patrons/:patron_id. This is already done in GET /patrons so should work out of the box with that simple spec change. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36562 --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- The correct way here is to have GET /patrons/{patron_id}/checkouts and read the X-Total-Count and X-Base-Total-Count headers. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org