diff --git a/src/Views/Home/Assets.cshtml b/src/Views/Home/Assets.cshtml index 2d94e58..0048a4a 100644 --- a/src/Views/Home/Assets.cshtml +++ b/src/Views/Home/Assets.cshtml @@ -495,9 +495,11 @@ document.addEventListener('DOMContentLoaded', () => { const asset = responseJson.assetsModel; const locationSelect = updateForm.querySelector('#updateLocationSelect'); - await loadLocationsIntoSelect(locationSelect, asset.Location); const usersSelect = updateForm.querySelector('#updateUsersSelect'); - await loadUsersIntoSelect(usersSelect, asset.Owner); + await Promise.all([ + loadLocationsIntoSelect(locationSelect, asset.Location), + loadUsersIntoSelect(usersSelect, asset.Owner) + ]); for (const [key, value] of Object.entries(asset)) { const input = updateForm.querySelector(`[name="${key}"]`); diff --git a/src/Views/Home/Inventory.cshtml b/src/Views/Home/Inventory.cshtml index d1e339d..dd0133d 100644 --- a/src/Views/Home/Inventory.cshtml +++ b/src/Views/Home/Inventory.cshtml @@ -309,11 +309,15 @@
- +
- +
@@ -416,7 +420,14 @@ document.addEventListener('DOMContentLoaded', () => { const response = await fetch(`/Assets/Get?cn=${assetId}`); const responseJson = await response.json(); const asset = responseJson.assetsModel; - + + const locationSelect = updateForm.querySelector('#updateLocationSelect'); + const usersSelect = updateForm.querySelector('#updateUsersSelect'); + await Promise.all([ + loadLocationsIntoSelect(locationSelect, asset.Location), + loadUsersIntoSelect(usersSelect, asset.Owner) + ]); + for (const [key, value] of Object.entries(asset)) { const input = updateForm.querySelector(`[name="${key}"]`); if (input) input.value = value; @@ -518,5 +529,56 @@ document.addEventListener('DOMContentLoaded', () => { }); + + + + \ No newline at end of file