Only offer vacant rooms in the tenant-invite room dropdown
The "Mieter einladen" form previously listed every room regardless of occupancy, letting a landlord accidentally assign a new invite to an already-occupied room. Filters lastRooms to status === 'VACANT' for that select only — ticket/inventory room pickers still show all rooms since those aren't about assigning a tenancy.
This commit is contained in:
parent
e77e33d7ff
commit
284a90222a
@ -1351,7 +1351,9 @@
|
||||
function populateRoomSelect() {
|
||||
const select = document.getElementById('inviteRoom');
|
||||
select.innerHTML = '<option value="">– kein Zimmer zuordnen –</option>';
|
||||
lastRooms.forEach(r => {
|
||||
// Nur freie Zimmer zur Auswahl anbieten — ein bereits belegtes Zimmer
|
||||
// kann nicht zusätzlich vergeben werden.
|
||||
lastRooms.filter(r => r.status === 'VACANT').forEach(r => {
|
||||
const opt = document.createElement('option');
|
||||
opt.value = r.id;
|
||||
opt.textContent = r.roomNumber;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user