QUick fixes in inventoryitems

This commit is contained in:
2024-09-06 09:43:02 +02:00
parent ab7df093c4
commit c8265aebea
2 changed files with 13 additions and 5 deletions

View File

@@ -68,6 +68,13 @@ defineShortcuts({
const dataStore = useDataStore()
const router = useRouter()
const items = ref([])
const setupPage = async () => {
items.value = await useSupabaseSelect("inventoryitems","*", "articleNumber")
}
setupPage()
const templateColumns = [
{
@@ -92,10 +99,10 @@ const columns = computed(() => templateColumns.filter((column) => selectedColumn
const searchString = ref('')
const filteredRows = computed(() => {
if(!searchString.value) {
return dataStore.inventoryitems
return items.value
}
return dataStore.inventoryitems.filter(product => {
return items.value.filter(product => {
return Object.values(product).some((value) => {
return String(value).toLowerCase().includes(searchString.value.toLowerCase())
})