fix: "без категории" filter matches rooms with undefined categoryId
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -46,7 +46,8 @@ export function RoomsPage() {
|
|||||||
r.type.toLowerCase().includes(search.toLowerCase()) ||
|
r.type.toLowerCase().includes(search.toLowerCase()) ||
|
||||||
(r.name ?? '').toLowerCase().includes(search.toLowerCase())
|
(r.name ?? '').toLowerCase().includes(search.toLowerCase())
|
||||||
const matchFloor = floorFilter === 'all' || r.floor === floorFilter
|
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
|
return matchSearch && matchFloor && matchCat
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user