From 880a57845410861912ae8e604b0282cd31bb11ee Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Tue, 3 Jan 2017 22:55:12 -0500 Subject: [PATCH] Display the correct failed operation on the dashboard edit-item page when it fails to edit/create a record --- resources/assets/js/dashboard.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/dashboard.js b/resources/assets/js/dashboard.js index dc50e70..e158398 100644 --- a/resources/assets/js/dashboard.js +++ b/resources/assets/js/dashboard.js @@ -226,7 +226,8 @@ function editItemInit() { $spinner = $("#loading-modal"), fadeTime = 250, model = $editItem.data("model"), - id = $editItem.data("id"); + id = $editItem.data("id"), + operation = id === "new" ? "create" : "update"; let allowTimes = [], simplemde = [], @@ -415,7 +416,7 @@ function editItemInit() { uploadImage(response.replace(/^id:/, "")); } else { hideLoadingModal(); - showAlert("ERROR: Failed to update record"); + showAlert("ERROR: Failed to " + operation + " record"); submitting = false; } });