fix(frontend): pre-select active unit when opening new equipment modal
When a unit is selected in the sidebar, the create-equipment modal now pre-fills the unit dropdown with that unit. Previously it always reset to empty, so newly created equipment got unit_id=null and was hidden by the unit filter after save. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d1131c4e2d
commit
d88d8375fd
|
|
@ -94,6 +94,9 @@ export function closeEquipmentModal() {
|
|||
|
||||
export function openCreateEquipmentModal() {
|
||||
resetEquipmentForm();
|
||||
if (state.selectedUnitId && dom.equipmentUnitId) {
|
||||
dom.equipmentUnitId.value = state.selectedUnitId;
|
||||
}
|
||||
openEquipmentModal();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue