Fix search bar crashing if remarks on item instance is null

This commit is contained in:
Keannu Bernasol 2023-12-17 23:59:02 +08:00
parent 6f2fb3900e
commit 18308d5055

View file

@ -146,12 +146,14 @@ export default function EquipmentInstancesListPage() {
.toLowerCase()
.includes(filter.toLowerCase()) ||
equipment.remarks
.toLowerCase()
.includes(filter.toLowerCase()) ||
equipment.last_updated
.toLowerCase()
.includes(filter.toLowerCase()) ||
equipment.status.toLowerCase() == filter.toLowerCase()
? equipment.remarks
.toLowerCase()
.includes(filter.toLowerCase())
: false ||
equipment.last_updated
.toLowerCase()
.includes(filter?.toLowerCase()) ||
equipment.status.toLowerCase() == filter.toLowerCase()
: // If filter keyword is null then we just pass through everything as if we did not filter at all
true
)