diff --git a/src/Views/Home/Inventory.cshtml b/src/Views/Home/Inventory.cshtml index fc70218..d409599 100644 --- a/src/Views/Home/Inventory.cshtml +++ b/src/Views/Home/Inventory.cshtml @@ -174,7 +174,6 @@ const modal = new bootstrap.Modal(viewModal); viewContent.innerHTML = '

@T["Loading..."]

'; - modal.show(); try { const response = await fetch(`/Assets/Get?cn=${decodedText}`); @@ -182,9 +181,12 @@ const asset = json.assetsModel; if (!asset) { - viewContent.innerHTML = `

@T["Asset not found."]

`; + const input = document.getElementById("barcodeInput"); + input.classList.add("is-invalid"); + showToast('@T["Asset not found."]', 'danger'); return; } + modal.show(); const html = `
@@ -378,6 +380,11 @@ } }); } + + document.getElementById("barcodeInput").addEventListener("input", e => { + e.target.classList.remove("is-invalid"); + }); + }