Bug 20006: (follow-up) Fix holds.js
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 24 Jan 2019 18:11:21 +0000 (15:11 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 19 Mar 2019 10:51:25 +0000 (10:51 +0000)
This patch makes holds.js call the endpoint with 'pickup_library_id'
instead of the old 'branchcode' property.

To test:
- Place a hold
- Go to the patron's detail page
- Go to the Holds tab
- Change the pickup location
=> SUCCESS: It works!

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f6b3d9979dc996dff7bf29fd5747e91695f93d0f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/js/holds.js

index 757eb6d..0ca8fb8 100644 (file)
@@ -202,7 +202,7 @@ $(document).ready(function() {
                     var res_id = $(this).attr('reserve_id');
                     $(this).after('<div id="updating_reserveno'+res_id+'" class="waiting"><img src="/intranet-tmpl/prog/img/spinner-small.gif" alt="" /><span class="waiting_msg"></span></div>');
                     var api_url = '/api/v1/holds/'+res_id;
-                    var update_info = JSON.stringify({ branchcode: $(this).val(), priority: parseInt($(this).attr("priority"),10) });
+                    var update_info = JSON.stringify({ pickup_library_id: $(this).val(), priority: parseInt($(this).attr("priority"),10) });
                     $.ajax({
                         method: "PUT",
                         url: api_url,