|
@ -19,7 +19,7 @@ $(document).ready(function(){ |
|
|
// If a bike is selected, forward to the bike
|
|
|
// If a bike is selected, forward to the bike
|
|
|
// checklist.
|
|
|
// checklist.
|
|
|
bike_id = parseInt($("#bike_id").val()); |
|
|
bike_id = parseInt($("#bike_id").val()); |
|
|
if( bike_id >= 0 ){ |
|
|
if( bike_id > 0 ){ |
|
|
forward = "/task_lists/" + bike_id + "/edit"; |
|
|
forward = "/task_lists/" + bike_id + "/edit"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -30,7 +30,6 @@ $(document).ready(function(){ |
|
|
bike_id: bike_id, |
|
|
bike_id: bike_id, |
|
|
description: $("#description_id").val(), |
|
|
description: $("#description_id").val(), |
|
|
}]}; |
|
|
}]}; |
|
|
console.log(json_data); |
|
|
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
url: $("#add_time_entry_submit").data("url"), |
|
|
url: $("#add_time_entry_submit").data("url"), |
|
@ -39,11 +38,9 @@ $(document).ready(function(){ |
|
|
contentType: 'application/json', |
|
|
contentType: 'application/json', |
|
|
dataType: "json", |
|
|
dataType: "json", |
|
|
success: function(data, status, xhr){ |
|
|
success: function(data, status, xhr){ |
|
|
console.log(data); |
|
|
|
|
|
window.location = forward; |
|
|
window.location = forward; |
|
|
}, |
|
|
}, |
|
|
error: function(data, status ){ |
|
|
error: function(data, status ){ |
|
|
console.log(data); |
|
|
|
|
|
displayFormErrors(data.responseJSON); |
|
|
displayFormErrors(data.responseJSON); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|