fix(frontend): Fix all type issues

This commit is contained in:
2025-11-15 08:40:09 +01:00
parent 1c8815d4ce
commit daf619d6eb
16 changed files with 88 additions and 56 deletions

View File

@@ -2,11 +2,21 @@ import type { Organization } from '~~/types/keycloak'
export const useUserStore = defineStore('Organization', () => {
const { user } = useUserSession()
const selectedOrganization = computed<Organization | null>(() => {
if (!user.value?.organizations || user.value.organizations.length === 0) {
return null
const _selectedOrganization = ref<Organization | null>(null)
const selectedOrganization = computed<Organization | null>({
get: () => {
if (_selectedOrganization.value) {
return _selectedOrganization.value
}
if (!user.value?.organizations || user.value.organizations.length === 0) {
return null
}
return user.value.organizations[0]
},
set: (value: Organization | null) => {
_selectedOrganization.value = value
}
return user.value.organizations[0]
})
return {