New Backend changes

This commit is contained in:
2025-09-02 18:47:12 +02:00
parent af86fdd8ed
commit 42edd626fd
5 changed files with 15 additions and 31 deletions

View File

@@ -158,22 +158,6 @@ const onTabChange = (index) => {
v-else-if="!props.inModal && platform === 'mobile'" v-else-if="!props.inModal && platform === 'mobile'"
:ui="{center: 'flex items-stretch gap-1.5 min-w-0'}" :ui="{center: 'flex items-stretch gap-1.5 min-w-0'}"
> >
<!-- <template #left>
<UButton
icon="i-heroicons-chevron-left"
variant="outline"
@click="router.back()/*router.push(`/standardEntity/${type}`)*/"
>
Zurück
</UButton>
<UButton
icon="i-heroicons-chevron-left"
variant="outline"
@click="router.push(`/standardEntity/${type}`)"
>
Übersicht
</UButton>
</template>-->
<template #toggle> <template #toggle>
<div></div> <div></div>
</template> </template>

View File

@@ -14,7 +14,7 @@ export const useEntities = (
const select = async ( const select = async (
select: string = "*", select: string = "*",
sortColumn: string | null = null, sortColumn: string | null = null,
ascending: boolean = true, ascending: boolean = false,
noArchivedFiltering: boolean = false noArchivedFiltering: boolean = false
) => { ) => {
@@ -23,7 +23,7 @@ export const useEntities = (
params: { params: {
select, select,
sort: sortColumn || undefined, sort: sortColumn || undefined,
asc: ascending ? "true" : "false" asc: ascending
} }
}) })
@@ -43,7 +43,7 @@ export const useEntities = (
) => { ) => {
if (!idToEq) return null if (!idToEq) return null
const res = await useNuxtApp().$api(`/api/resource/${relation}/${idToEq}/${withInformation}`, { const res = await useNuxtApp().$api(withInformation ? `/api/resource/${relation}/${idToEq}/${withInformation}` : `/api/resource/${relation}/${idToEq}`, {
method: "GET", method: "GET",
params: { select } params: { select }
}) })

View File

@@ -478,7 +478,7 @@ const setCustomerData = async (customerId, loadOnlyAdress = false) => {
} }
const setContactPersonData = async () => { const setContactPersonData = async () => {
//console.log(itemInfo.value.contactPerson) //TODO: BACKEND CHANGE Set Profile //console.log(itemInfo.value.contactPerson) //TODO Set Profile
let profile = await useSupabaseSelectSingle("profiles",itemInfo.value.contactPerson, '*') let profile = await useSupabaseSelectSingle("profiles",itemInfo.value.contactPerson, '*')
itemInfo.value.contactPersonName = profile.fullName itemInfo.value.contactPersonName = profile.fullName

View File

@@ -1,5 +1,5 @@
<template> <template>
<!-- <UDashboardNavbar title="Home"> <UDashboardNavbar title="Home">
<template #right> <template #right>
<!-- <UTooltip text="Notifications" :shortcuts="['N']"> <!-- <UTooltip text="Notifications" :shortcuts="['N']">
<UButton color="gray" variant="ghost" square @click="isNotificationsSlideoverOpen = true"> <UButton color="gray" variant="ghost" square @click="isNotificationsSlideoverOpen = true">
@@ -57,7 +57,7 @@
<display-open-tasks/> <display-open-tasks/>
</UDashboardCard> </UDashboardCard>
</UPageGrid> </UPageGrid>
</UDashboardPanelContent>--> </UDashboardPanelContent>
</template> </template>
<script setup> <script setup>

View File

@@ -22,7 +22,10 @@ const mode = ref("list")
const items = ref([]) const items = ref([])
const item = ref({}) const item = ref({})
const setupPage = async () => {
const setupPage = async (sort_column = null,sort_direction = null) => {
loaded.value = false
if(await useCapacitor().getIsPhone()) { if(await useCapacitor().getIsPhone()) {
setPageLayout("mobile") setPageLayout("mobile")
@@ -32,23 +35,18 @@ const setupPage = async () => {
if(mode.value === "show") { if(mode.value === "show") {
//Load Data for Show //Load Data for Show
//item.value = await useSupabaseSelectSingle(type, route.params.id, dataType.supabaseSelectWithInformation || "*")
item.value = await useEntities(type).selectSingle(route.params.id,"*",true) item.value = await useEntities(type).selectSingle(route.params.id,"*",true)
} else if(mode.value === "edit") { } else if(mode.value === "edit") {
//Load Data for Edit //Load Data for Edit
//const data = JSON.stringify((await supabase.from(type).select().eq("id", route.params.id).single()).data)
//await useSupabaseSelectSingle(type, route.params.id)
item.value = JSON.stringify(await useEntities(type).selectSingle(route.params.id)) item.value = JSON.stringify(await useEntities(type).selectSingle(route.params.id))
//item.value = data
} else if(mode.value === "create") { } else if(mode.value === "create") {
//Load Data for Create //Load Data for Create
item.value = JSON.stringify({}) item.value = JSON.stringify({})
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 useEntities(type).select() items.value = await useEntities(type).select(dataType.supabaseSelectWithInformation, sort_column || dataType.supabaseSortColumn , sort_direction === "asc")
} }
loaded.value = true loaded.value = true
@@ -68,17 +66,19 @@ setupPage()
:platform="platform" :platform="platform"
/> />
<EntityEdit <EntityEdit
v-else-if="loaded && (mode === 'edit' || mode === 'create')" v-else-if="(mode === 'edit' || mode === 'create')"
:type="route.params.type" :type="route.params.type"
:item="item" :item="item"
:mode="mode" :mode="mode"
:platform="platform" :platform="platform"
/> />
<EntityList <EntityList
v-else-if="loaded && mode === 'list'" :loading="!loaded"
v-else-if="mode === 'list'"
:type="type" :type="type"
:items="items" :items="items"
:platform="platform" :platform="platform"
@sort="(i) => setupPage(i.sort_column, i.sort_direction)"
/> />
<UProgress <UProgress
v-else v-else