Bug 19072

Summary: REST API: Toggle suspend for /api/v1/holds
Product: Koha Reporter: Lari Taskula <lari.taskula>
Component: REST APIAssignee: Lari Taskula <lari.taskula>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P5 - low CC: benjamin.rokseth, jonathan.druart, josef.moravec
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 18137    
Bug Blocks:    
Attachments: Bug 19072: Toggle suspend for /api/v1/holds
Bug 19072: Toggle suspend for /api/v1/holds
Bug 19072: Toggle suspend for /api/v1/holds
Bug 19072: Toggle suspend for /api/v1/holds
Bug 19072: Toggle suspend for /api/v1/holds

Description Lari Taskula 2017-08-10 09:30:56 UTC
Toggle suspend is missing from /api/v1/holds.
Comment 1 Lari Taskula 2017-08-10 09:33:42 UTC Comment hidden (obsolete)
Comment 2 Lari Taskula 2017-08-10 10:21:20 UTC Comment hidden (obsolete)
Comment 3 Lari Taskula 2017-08-10 10:52:27 UTC Comment hidden (obsolete)
Comment 4 Lari Taskula 2017-08-10 11:01:30 UTC Comment hidden (obsolete)
Comment 5 Lari Taskula 2017-08-10 11:03:08 UTC
Created attachment 65796 [details] [review]
Bug 19072: Toggle suspend for /api/v1/holds

This patch adds ability to toggle suspend for a hold.

To test:
1. prove t/db_dependent/api/v1/holds.t
2. Send a PUT request to suspended hold with suspend_until parameter as null
3. Observe that hold is now resumed
Comment 6 Benjamin Rokseth 2017-09-05 13:41:33 UTC
The use of C4::Reserves::ToggleSuspend is a bit counter-intuitive here. If you send a PUT to /api/v1/holds/x with '{"suspend":false}' it would suspend hold if it was not already suspended.

I would rather respect the body request and suspend according to that, or you would have unpredictable results.
Comment 7 Josef Moravec 2019-04-01 12:50:17 UTC

*** This bug has been marked as a duplicate of bug 22206 ***