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'"
: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>
<div></div>
</template>

View File

@@ -14,7 +14,7 @@ export const useEntities = (
const select = async (
select: string = "*",
sortColumn: string | null = null,
ascending: boolean = true,
ascending: boolean = false,
noArchivedFiltering: boolean = false
) => {
@@ -23,7 +23,7 @@ export const useEntities = (
params: {
select,
sort: sortColumn || undefined,
asc: ascending ? "true" : "false"
asc: ascending
}
})
@@ -43,7 +43,7 @@ export const useEntities = (
) => {
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",
params: { select }
})

View File

@@ -478,7 +478,7 @@ const setCustomerData = async (customerId, loadOnlyAdress = false) => {
}
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, '*')
itemInfo.value.contactPersonName = profile.fullName

View File

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

View File

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