Originally proposed on bug 34784, I'm moving the patches here to ease readability and have a smaller testing scope.
Created attachment 173132 [details] [review] Bug 38226: API spec Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 173133 [details] [review] Bug 38226: Add RPC route for updating item callnumbers for a biblio This patch takes the idea implemented on the original patch, moves it to the /rpc namespace to make it clear this is not a RESTful endpoint. Code gets improved a bit, using some patterns we are using nowadays. The return value gets a bit more information and. A big change is it now uses `Koha::Items->batch_update`. It originally used `Koha::Items->update` with the `no_trigger` option. It felt like `batch_update` is a bit more smart in terms of triggering indexing at the end of the update, and only for the host biblio. It looks like that was the spirit of the original implementation, but missed to actually trigger indexing at the end of the call. To test: 1. Apply this patches 2.Run: $ ktd --shell k$ yarn api:bundle k$ restart_all 3. Run the tests: k$ prove t/db_dependent/api/v1/rpc/biblios.t => SUCCESS: Tests pass! 4. Try the new routes with Postman or your favourite tool (if they don't match) => SUCCESS: The desired behavior is what you get. 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 174242 [details] [review] Bug 38226: API spec Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 174243 [details] [review] Bug 38226: Add RPC route for updating item callnumbers for a biblio This patch takes the idea implemented on the original patch, moves it to the /rpc namespace to make it clear this is not a RESTful endpoint. Code gets improved a bit, using some patterns we are using nowadays. The return value gets a bit more information and. A big change is it now uses `Koha::Items->batch_update`. It originally used `Koha::Items->update` with the `no_trigger` option. It felt like `batch_update` is a bit more smart in terms of triggering indexing at the end of the update, and only for the host biblio. It looks like that was the spirit of the original implementation, but missed to actually trigger indexing at the end of the call. To test: 1. Apply this patches 2.Run: $ ktd --shell k$ yarn api:bundle k$ restart_all 3. Run the tests: k$ prove t/db_dependent/api/v1/rpc/biblios.t => SUCCESS: Tests pass! 4. Try the new routes with Postman or your favourite tool (if they don't match) => SUCCESS: The desired behavior is what you get. 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>