fix: "без категории" filter matches rooms with undefined categoryId

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-23 14:07:35 +03:00
parent d46101b032
commit 6bf1391890

View File

@@ -46,7 +46,8 @@ export function RoomsPage() {
r.type.toLowerCase().includes(search.toLowerCase()) ||
(r.name ?? '').toLowerCase().includes(search.toLowerCase())
const matchFloor = floorFilter === 'all' || r.floor === floorFilter
const matchCat = categoryFilter === 'all' || r.categoryId === categoryFilter
const matchCat = categoryFilter === 'all' ||
(categoryFilter === '' ? !r.categoryId : r.categoryId === categoryFilter)
return matchSearch && matchFloor && matchCat
})