New Backend changes
This commit is contained in:
@@ -3,12 +3,12 @@ import {setPageLayout} from "#app";
|
||||
import {useCapacitor} from "~/composables/useCapacitor.js";
|
||||
|
||||
definePageMeta({
|
||||
middleware: "auth",
|
||||
layout: "default",
|
||||
})
|
||||
const route = useRoute()
|
||||
const dataStore = useDataStore()
|
||||
const supabase = useSupabaseClient()
|
||||
const api = useNuxtApp().$api
|
||||
|
||||
|
||||
const type = route.params.type
|
||||
const platform = await useCapacitor().getIsPhone() ? "mobile" : "default"
|
||||
@@ -32,12 +32,14 @@ const setupPage = async () => {
|
||||
|
||||
if(mode.value === "show") {
|
||||
//Load Data for Show
|
||||
item.value = await useSupabaseSelectSingle(type, route.params.id, dataType.supabaseSelectWithInformation || "*")
|
||||
//item.value = await useSupabaseSelectSingle(type, route.params.id, dataType.supabaseSelectWithInformation || "*")
|
||||
item.value = await useEntities(type).selectSingle(route.params.id,"*",true)
|
||||
} else if(mode.value === "edit") {
|
||||
//Load Data for Edit
|
||||
const data = JSON.stringify((await supabase.from(type).select().eq("id", route.params.id).single()).data)
|
||||
//const data = JSON.stringify((await supabase.from(type).select().eq("id", route.params.id).single()).data)
|
||||
//await useSupabaseSelectSingle(type, route.params.id)
|
||||
item.value = data
|
||||
item.value = JSON.stringify(await useEntities(type).selectSingle(route.params.id))
|
||||
//item.value = data
|
||||
|
||||
} else if(mode.value === "create") {
|
||||
//Load Data for Create
|
||||
@@ -46,7 +48,7 @@ const setupPage = async () => {
|
||||
console.log(item.value)
|
||||
} else if(mode.value === "list") {
|
||||
//Load Data for List
|
||||
items.value = await useSupabaseSelect(type, dataType.supabaseSelectWithInformation || "*", dataType.supabaseSortColumn,dataType.supabaseSortAscending || false, true)
|
||||
items.value = await useEntities(type).select()
|
||||
}
|
||||
|
||||
loaded.value = true
|
||||
|
||||
Reference in New Issue
Block a user