Fix Banking and Profiles
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 14s
Build and Push Docker Images / build-frontend (push) Successful in 59s

This commit is contained in:
2026-03-23 08:29:54 +01:00
parent e0e99ba6f5
commit 4db753d34a
2 changed files with 54 additions and 21 deletions

View File

@@ -1,11 +1,39 @@
<script setup>
const router = useRouter()
const toast = useToast()
const items = ref([])
const pending = ref(true)
const mapProfileRow = (user) => {
const profile = user?.profile || {}
return {
id: profile?.id || null,
employee_number: profile?.employee_number || '',
full_name: profile?.full_name || user?.full_name || user?.email || 'Ohne Profil',
email: user?.email || profile?.email || ''
}
}
const setupPage = async () => {
items.value = (await useNuxtApp().$api("/api/tenant/users")).users
items.value = items.value.map(i => i.profile)
pending.value = true
try {
const response = await useNuxtApp().$api("/api/tenant/users")
items.value = (response?.users || [])
.map(mapProfileRow)
.filter((item) => !!item.id)
} catch (err) {
console.error('[staff/profiles/index]', err)
items.value = []
toast.add({
title: 'Profile konnten nicht geladen werden',
color: 'error'
})
} finally {
pending.value = false
}
}
setupPage()
@@ -31,7 +59,7 @@
<UDashboardNavbar title="Benutzer Einstellungen">
<template #right>
<UButton
@click="router.push(`/profiles/create`)"
@click="router.push(`/staff/profiles/create`)"
disabled
>
+ Mitarbeiter
@@ -41,9 +69,14 @@
<UTable
:data="items"
:columns="normalizeTableColumns(columns)"
:on-select="(i) => navigateTo(`/staff/profiles/${i.id}`)"
:loading="pending"
:on-select="(row) => navigateTo(`/staff/profiles/${row.original?.id || row.id}`)"
>
<template #empty>
<div class="py-10 text-center text-sm text-gray-500">
Keine Mitarbeiterprofile gefunden.
</div>
</template>
</UTable>
</template>