Introduced ProfileStore

Corrected All Links to DataStore
This commit is contained in:
2024-12-21 22:33:42 +01:00
parent 813944fc23
commit b465f4a75a
64 changed files with 508 additions and 959 deletions

View File

@@ -1,30 +1,29 @@
<script setup>
const dataStore = useDataStore()
const profileStore = useProfileStore()
const supabase = useSupabaseClient()
//const tenants = ref(dataStore.getOwnProfile ? dataStore.getOwnProfile.tenants : [])
//const tenant = ref(dataStore.currentTenant)
const selectedProfile = ref(dataStore.activeProfile.id)
const selectedProfile = ref(profileStore.activeProfile.id)
</script>
<template>
<USelectMenu
:options="dataStore.ownProfiles"
:options="profileStore.ownProfiles"
value-attribute="id"
class="w-40"
@change="dataStore.changeProfile(selectedProfile)"
@change="profileStore.changeProfile(selectedProfile)"
v-model="selectedProfile"
>
<UButton color="gray" variant="ghost" :class="[open && 'bg-gray-50 dark:bg-gray-800']" class="w-full">
<UAvatar :alt="dataStore.tenants.find(i => dataStore.getProfileById(selectedProfile).tenant === i.id).name" size="md" />
<UAvatar :alt="profileStore.tenants.find(i => profileStore.profiles.find(i => i.id === selectedProfile).tenant === i.id).name" size="md" />
<span class="truncate text-gray-900 dark:text-white font-semibold">{{dataStore.tenants.find(i => dataStore.getProfileById(selectedProfile).tenant === i.id).name}}</span>
<span class="truncate text-gray-900 dark:text-white font-semibold">{{profileStore.tenants.find(i => profileStore.profiles.find(i => i.id === selectedProfile).tenant === i.id).name}}</span>
</UButton>
<template #option="{option}">
{{dataStore.tenants.find(i => i.id === option.tenant).name}}
{{profileStore.tenants.find(i => i.id === option.tenant).name}}
</template>
</USelectMenu>
</template>