fixing vlad's review comments

This commit is contained in:
Tiago Vasconcelos 2023-03-09 10:00:55 +00:00
parent cf12ee9287
commit f9fc52ac52
5 changed files with 63 additions and 73 deletions

View file

@ -62,12 +62,13 @@ const market = async () => {
if (this.activeStall) {
products = products.filter(p => p.stall_id == this.activeStall)
}
if (!this.searchText || this.searchText.length < 2) return products
const searchText = this.searchText.toLowerCase()
if (!searchText || searchText.length < 2) return products
return products.filter(p => {
return (
p.name.includes(this.searchText) ||
p.description.includes(this.searchText) ||
p.categories.includes(this.searchText)
p.name.toLowerCase().includes(searchText) ||
p.description.toLowerCase().includes(searchText) ||
p.categories.toLowerCase().includes(searchText)
)
})
},