diff --git a/composables/useFiles.js b/composables/useFiles.js index a64dafc..41a34f1 100644 --- a/composables/useFiles.js +++ b/composables/useFiles.js @@ -87,12 +87,12 @@ export const useFiles = () => { } const selectDocuments = async (sortColumn = null, folder = null) => { - let data = null + let data = [] if(sortColumn !== null ) { data = (await supabase .from("files") - .select('*, filetags(*), project(*), vendor(*), customer(*), contract(*), plant(*), createddocument(*), vehicle(*), product(*), profile(*), check(*), inventoryitem(*)') + .select('*, incominginvoice(*), project(*), vendor(*), customer(*), contract(*), plant(*), createddocument(*), vehicle(*), product(*), profile(*), check(*), inventoryitem(*)') .eq("tenant", profileStore.currentTenant) .not("path","is",null) .not("archived","is",true) @@ -100,7 +100,7 @@ export const useFiles = () => { } else { data = (await supabase .from("files") - .select('*, filetags(*), project(*), vendor(*), customer(*), contract(*), plant(*), createddocument(*), vehicle(*), product(*), profile(*), check(*), inventoryitem(*)') + .select('*, incominginvoice(*), project(*), vendor(*), customer(*), contract(*), plant(*), createddocument(*), vehicle(*), product(*), profile(*), check(*), inventoryitem(*)') .eq("tenant", profileStore.currentTenant) .not("path","is",null) .not("archived","is",true)).data @@ -135,7 +135,7 @@ export const useFiles = () => { if(sortColumn !== null ) { data = (await supabase .from("files") - .select('*, filetags(*), project(*), vendor(*), customer(*), contract(*), plant(*), createddocument(*), vehicle(*), product(*), profile(*), check(*), inventoryitem(*)') + .select('*, incominginvoice(*), project(*), vendor(*), customer(*), contract(*), plant(*), createddocument(*), vehicle(*), product(*), profile(*), check(*), inventoryitem(*)') .in("id",documentIds) .eq("tenant", profileStore.currentTenant) .not("path","is",null) @@ -144,7 +144,7 @@ export const useFiles = () => { } else { data = (await supabase .from("files") - .select('*, filetags(*), project(*), vendor(*), customer(*), contract(*), plant(*), createddocument(*), vehicle(*), product(*), profile(*), check(*), inventoryitem(*)') + .select('*, incominginvoice(*), project(*), vendor(*), customer(*), contract(*), plant(*), createddocument(*), vehicle(*), product(*), profile(*), check(*), inventoryitem(*)') .in("id",documentIds) .not("path","is",null) .not("archived","is",true) @@ -177,7 +177,7 @@ export const useFiles = () => { const selectDocument = async (id) => { const {data,error} = await supabase .from("files") - .select('*, filetags(*)') + .select('*') .eq("id",id) .single()