From 306c83a6d6f702ed92ef0a4ffaf7e8afdbaa409f Mon Sep 17 00:00:00 2001 From: Mateja Date: Mon, 16 Nov 2020 23:06:24 +0100 Subject: Reservations action notice... --- public/js/reservations.js | 13 +++++-------- resources/views/pages/reservations.blade.php | 1 + 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/public/js/reservations.js b/public/js/reservations.js index 781b835..bc9c6de 100644 --- a/public/js/reservations.js +++ b/public/js/reservations.js @@ -86,8 +86,7 @@ function btnAction(action, btn) { try { // Handle various actions if (response.action == "update") { - //document.getElementById("notice").innerText = "Record #" + actionData.id + " updated."; - console.log('Record #' + actionData.id + ' updated.'); + jQuery('#notice').html("Record #" + actionData.id + " updated."); } else if (response.action == "restore") { trData[1].firstElementChild.checked = response.approved == 1; trData[2].innerText = response.operatorCall; @@ -100,13 +99,11 @@ function btnAction(action, btn) { trData[9].innerText = response.operatorName; trData[10].innerText = response.operatorEmail; trData[11].innerText = response.operatorPhone; - //document.getElementById("notice").innerText = "Record's #" + actionData.id + " data restored."; - //console.log('Record #' + actionData.id + ' data restored.'); + jQuery('#notice').html("Record's #" + actionData.id + " data restored."); } else if (response.action == "delete") { - //document.getElementById("notice").innerText = "Record #" + actionData.id + " deleted."; - //console.log('Record #' + actionData.id + ' deleted.'); + jQuery('#notice').html("Record #" + actionData.id + " deleted."); } else { - //console.log("No action?"); + console.log("No action?"); //console.log(data); } } catch { @@ -115,7 +112,7 @@ function btnAction(action, btn) { } } else { - //console.log('AJAX error'); + console.log('AJAX error'); alert("Bad input data!"); } }); diff --git a/resources/views/pages/reservations.blade.php b/resources/views/pages/reservations.blade.php index 06c0335..addc9a9 100644 --- a/resources/views/pages/reservations.blade.php +++ b/resources/views/pages/reservations.blade.php @@ -19,6 +19,7 @@ @endforeach @endif +
-- cgit v1.2.3