Add holidays routes to backend and frontend; implement holiday associations and update UI components for admin holidays management
This commit is contained in:
@@ -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 = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user