mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 15:01:56 +00:00
Fixed bug: /Home/Inventory modal showing despite invalid Asset Id
This commit is contained in:
@@ -174,7 +174,6 @@
|
||||
const modal = new bootstrap.Modal(viewModal);
|
||||
|
||||
viewContent.innerHTML = '<p class="text-center text-muted">@T["Loading..."]</p>';
|
||||
modal.show();
|
||||
|
||||
try {
|
||||
const response = await fetch(`/Assets/Get?cn=${decodedText}`);
|
||||
@@ -182,9 +181,12 @@
|
||||
const asset = json.assetsModel;
|
||||
|
||||
if (!asset) {
|
||||
viewContent.innerHTML = `<p class="text-danger text-center">@T["Asset not found."]</p>`;
|
||||
const input = document.getElementById("barcodeInput");
|
||||
input.classList.add("is-invalid");
|
||||
showToast('@T["Asset not found."]', 'danger');
|
||||
return;
|
||||
}
|
||||
modal.show();
|
||||
|
||||
const html = `
|
||||
<div class="row g-3">
|
||||
@@ -378,6 +380,11 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById("barcodeInput").addEventListener("input", e => {
|
||||
e.target.classList.remove("is-invalid");
|
||||
});
|
||||
|
||||
</script>
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user