From a7f19944046df97f8d48febec4d6bf481c49a6e8 Mon Sep 17 00:00:00 2001 From: objecttothis <17935339+objecttothis@users.noreply.github.com> Date: Wed, 19 Aug 2026 17:37:52 +0400 Subject: [PATCH] fix(view): conditionally reload stock locations on success response - Updated AJAX response handler to reload stock locations only when the operation is successful. Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com> --- app/Views/configs/stock_config.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Views/configs/stock_config.php b/app/Views/configs/stock_config.php index e5fe17ce6..f4084961e 100644 --- a/app/Views/configs/stock_config.php +++ b/app/Views/configs/stock_config.php @@ -120,10 +120,12 @@ }, { type: response.success ? 'success' : 'danger' }); - $("#stock_locations").load('', function() { - init_add_remove_locations(); - init_sortable_locations(); - }); + if (response.success) { + $("#stock_locations").load('', function() { + init_add_remove_locations(); + init_sortable_locations(); + }); + } }, dataType: 'json' });