From e06fda69ef263e1fe286abc7aa8d10e2c97d6344 Mon Sep 17 00:00:00 2001 From: wahyun Date: Mon, 22 Jul 2024 08:41:01 +0700 Subject: [PATCH] fix: disabled false button report --- edit-mode/function/reportActivity.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/edit-mode/function/reportActivity.js b/edit-mode/function/reportActivity.js index 9bb2862..4623748 100644 --- a/edit-mode/function/reportActivity.js +++ b/edit-mode/function/reportActivity.js @@ -460,10 +460,12 @@ $(document).ready(function () { tableRaMaterialActual.draw(); } else { $('#btn_add_ra_material').html('Add'); + $('#btn_add_ra_material').prop("disabled", false); throw new Error("Add report activity material failed."); } } catch (error) { $('#btn_add_ra_material').html('Add'); + $('#btn_add_ra_material').prop("disabled", false); throw new Error("Image upload failed."); } } catch (error) { @@ -480,7 +482,8 @@ $(document).ready(function () { } }); } else { - resetFormAddRaMaterial(); + $('#btn_add_ra_material').html('Add'); + $('#btn_add_ra_material').prop("disabled", false); gantt.alert("Add report activity material failed."); } } @@ -493,12 +496,13 @@ $(document).ready(function () { .catch((error) => error.response); if (result && result.status == 200) { - gantt.alert("Edit report activity Success!"); resetFormAddRaMaterial(); + gantt.alert("Edit report activity Success!"); tableRaMaterialActual.draw(); } else { resetFormAddRaMaterial(); $('#btn_add_ra_material').html('Add'); + $('#btn_add_ra_material').prop("disabled", false); gantt.alert("Edit report activity failed, try again later!"); } }