|
Lines 96-107
function display_pickup_location (state) {
Link Here
|
| 96 |
$(document).ready(function() { |
96 |
$(document).ready(function() { |
| 97 |
|
97 |
|
| 98 |
function suspend_hold(hold_id, end_date) { |
98 |
function suspend_hold(hold_id, end_date) { |
|
|
99 |
|
| 100 |
var params; |
| 101 |
if ( end_date !== null && end_date !== '' ) params = JSON.stringify({ "end_date": end_date }); |
| 102 |
|
| 99 |
return $.ajax({ |
103 |
return $.ajax({ |
| 100 |
method: 'POST', |
104 |
method: 'POST', |
| 101 |
url: '/api/v1/holds/'+encodeURIComponent(hold_id)+'/suspension', |
105 |
url: '/api/v1/holds/'+encodeURIComponent(hold_id)+'/suspension', |
| 102 |
data: function () { |
106 |
contentType: 'application/json', |
| 103 |
if ( end_date !== null ) return JSON.stringify({ "end_date": end_date }) |
107 |
data: params |
| 104 |
} |
|
|
| 105 |
}); |
108 |
}); |
| 106 |
} |
109 |
} |
| 107 |
|
110 |
|
|
Lines 401-407
$(document).ready(function() {
Link Here
|
| 401 |
|
404 |
|
| 402 |
$("#suspend-modal-submit").on( "click", function( e ) { |
405 |
$("#suspend-modal-submit").on( "click", function( e ) { |
| 403 |
e.preventDefault(); |
406 |
e.preventDefault(); |
| 404 |
var suspend_until_date = $("#suspend-modal-until").datepicker("getDate"); |
407 |
var suspend_until_date = $("#suspend-modal-until").val(); |
| 405 |
if ( suspend_until_date !== null ) suspend_until_date = $date(suspend_until_date, {dateformat:"rfc3339"}); |
408 |
if ( suspend_until_date !== null ) suspend_until_date = $date(suspend_until_date, {dateformat:"rfc3339"}); |
| 406 |
suspend_hold( |
409 |
suspend_hold( |
| 407 |
$(this).data('hold-id'), |
410 |
$(this).data('hold-id'), |
| 408 |
- |
|
|