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>
This commit is contained in:
objecttothis committed 2026-08-19 17:37:52 +04:00
1 parent 39124e8132
commit a7f1994404
1 file changed
+6 -4
+6 -4
View File
@@ -120,10 +120,12 @@
}, {
type: response.success ? 'success' : 'danger'
});
$("#stock_locations").load('<?= "config/stockLocations" ?>', function() {
init_add_remove_locations();
init_sortable_locations();
});
if (response.success) {
$("#stock_locations").load('<?= "config/stockLocations" ?>', function() {
init_add_remove_locations();
init_sortable_locations();
});
}
},
dataType: 'json'
});