DELETE request to /api/v1/holds/{holdkey} simply cancels a waiting hold if that is allowed. It should instead generate a cancellation request We should add a new endpoint: DELETE /api/v1/public/patrons/:patron_id/holds/:hold_id And it should return a 202 accepted response as the actual deletion doesn't happen until the library confirms
Created attachment 152107 [details] [review] Bug 33573: Unit tests
Created attachment 152108 [details] [review] Bug 33573: Add public endpoint for cancelling holds This patch introduces a public endpoint for cancelling holds. Cancellation requests are generated when the hold is waiting and configuration allows requesting cancellation, as the OPAC does right now. Tests cover all the use cases. To test: 1. Apply this patches 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/patrons_holds.t => SUCCESS: Tests pass! 3. Sign off :-D
Created attachment 152112 [details] [review] Bug 33573: Unit tests Signed-off-by: Sam Lau <samalau@gmail.com>
Created attachment 152113 [details] [review] Bug 33573: Add public endpoint for cancelling holds This patch introduces a public endpoint for cancelling holds. Cancellation requests are generated when the hold is waiting and configuration allows requesting cancellation, as the OPAC does right now. Tests cover all the use cases. To test: 1. Apply this patches 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/patrons_holds.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Sam Lau <samalau@gmail.com>
Created attachment 152114 [details] [review] Bug 33573: Unit tests Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Created attachment 152115 [details] [review] Bug 33573: Add public endpoint for cancelling holds This patch introduces a public endpoint for cancelling holds. Cancellation requests are generated when the hold is waiting and configuration allows requesting cancellation, as the OPAC does right now. Tests cover all the use cases. To test: 1. Apply this patches 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/patrons_holds.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Our Aspen library is excited to get this function.
Created attachment 152904 [details] [review] Bug 33573: Unit tests Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Created attachment 152905 [details] [review] Bug 33573: Add public endpoint for cancelling holds This patch introduces a public endpoint for cancelling holds. Cancellation requests are generated when the hold is waiting and configuration allows requesting cancellation, as the OPAC does right now. Tests cover all the use cases. To test: 1. Apply this patches 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/patrons_holds.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Pushed to master for 23.11. Nice work everyone, thanks!
Any chance for backport on this one? The API endpoint is necessary for the hold cancellation from OPAC feature to work correctly for Koha/Aspen libraries.
+1
+1 for the backport to 22.11 and the quick fix. We'd like to be able to turn this on in Aspen, too.
We need a decision from the 23.05 RMaint first here. Marking the bug accordingly to get some attention.
This shouldn't cause any issues downstream or with end users.. choosing to backport.
Thanks for all the hard work! Pushed to 23.05.x for the next release
Nice work everyone! Pushed to oldstable for 22.11.x