Many Changes in Navigation, Shortcuts, Search and Data Pulling directly from Supabase
This commit is contained in:
@@ -1,31 +1,14 @@
|
||||
|
||||
|
||||
export const useSearch = (searchString,items) => {
|
||||
const dataStore = useDataStore()
|
||||
|
||||
if(!searchString) {
|
||||
return items
|
||||
}
|
||||
|
||||
items = items.map(item => {
|
||||
|
||||
return {
|
||||
...item,
|
||||
customer: dataStore.getCustomerById(item.customer)
|
||||
}
|
||||
})
|
||||
|
||||
console.log(items)
|
||||
|
||||
|
||||
|
||||
return items.filter(i => JSON.stringify(i).toLowerCase().includes(searchString.toLowerCase()))
|
||||
|
||||
/*return items.filter(item => {
|
||||
return Object.values(item).some((value) => {
|
||||
return String(value).toLowerCase().includes(searchString.toLowerCase())
|
||||
})
|
||||
})*/
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user