Fix in Archived Filtering
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import {useDataStore} from "~/stores/data.js";
|
import {useDataStore} from "~/stores/data.js";
|
||||||
|
|
||||||
|
|
||||||
export const useSupabaseSelect = async (relation,select = '*', sortColumn = null, ascending = true) => {
|
export const useSupabaseSelect = async (relation,select = '*', sortColumn = null, ascending = true,noArchivedFiltering = false) => {
|
||||||
const supabase = useSupabaseClient()
|
const supabase = useSupabaseClient()
|
||||||
const profileStore = useProfileStore()
|
const profileStore = useProfileStore()
|
||||||
let data = null
|
let data = null
|
||||||
@@ -22,7 +22,7 @@ export const useSupabaseSelect = async (relation,select = '*', sortColumn = null
|
|||||||
.eq("tenant", profileStore.currentTenant)).data
|
.eq("tenant", profileStore.currentTenant)).data
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dataType && dataType.isArchivable) {
|
if(dataType && dataType.isArchivable && !noArchivedFiltering) {
|
||||||
data = data.filter(i => !i.archived)
|
data = data.filter(i => !i.archived)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const setupPage = async () => {
|
|||||||
console.log(item.value)
|
console.log(item.value)
|
||||||
} else if(mode.value === "list") {
|
} else if(mode.value === "list") {
|
||||||
//Load Data for List
|
//Load Data for List
|
||||||
items.value = await useSupabaseSelect(type, dataType.supabaseSelectWithInformation || "*", dataType.supabaseSortColumn,dataType.supabaseSortAscending || false)
|
items.value = await useSupabaseSelect(type, dataType.supabaseSelectWithInformation || "*", dataType.supabaseSortColumn,dataType.supabaseSortAscending || false, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
loaded.value = true
|
loaded.value = true
|
||||||
|
|||||||
Reference in New Issue
Block a user