Add holidays routes to backend and frontend; implement holiday associations and update UI components for admin holidays management

This commit is contained in:
Torsten Schulz (local)
2025-10-17 22:35:31 +02:00
parent 6a0b23e694
commit 67ddf812cd
15 changed files with 1058 additions and 2 deletions

View File

@@ -44,7 +44,17 @@ import { useAuthStore } from '../stores/authStore'
const auth = useAuthStore()
// Rolle: 'user' | 'admin' (Fallback: 'user')
const role = computed(() => (auth.user?.role || 'user').toString().toLowerCase())
// Verwende role_string (vom Backend gemappt) oder fallback zu 'user'
const role = computed(() => {
if (auth.user?.role_string) {
return auth.user.role_string.toLowerCase()
}
// Fallback für alte Implementierung oder wenn role ein Number ist
if (typeof auth.user?.role === 'number') {
return auth.user.role === 1 ? 'admin' : 'user'
}
return (auth.user?.role || 'user').toString().toLowerCase()
})
const SECTIONS_USER = [
{