Remodel of Profile System
Added isCompany to Customers changes in workingtimes.vue
This commit is contained in:
31
spaces/composables/useSearch.js
Normal file
31
spaces/composables/useSearch.js
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
|
||||
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).includes(searchString))
|
||||
|
||||
/*return items.filter(item => {
|
||||
return Object.values(item).some((value) => {
|
||||
return String(value).toLowerCase().includes(searchString.toLowerCase())
|
||||
})
|
||||
})*/
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user