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

@@ -4,6 +4,7 @@ definePageMeta({
})
const dataStore = useDataStore()
const profileStore = useProfileStore()
const route = useRoute()
const router = useRouter()
const toast = useToast()
@@ -12,7 +13,7 @@ const id = ref(route.params.id ? route.params.id : null )
//Working
const mode = ref(route.params.mode || "show")
const itemInfo = ref({
profile: dataStore.activeProfile.id
profile: profileStore.activeProfile.id
})
const oldItemInfo = ref({})
const categories = ["Offen", "In Bearbeitung", "Dringed", "Erledigt"]
@@ -148,7 +149,7 @@ setupPage()
>
<USelectMenu
v-model="itemInfo.profile"
:options="dataStore.profiles"
:options="profileStore.profiles"
option-attribute="fullName"
value-attribute="id"
searchable-placeholder="Suche..."
@@ -156,7 +157,7 @@ setupPage()
:search-attributes="['fullName']"
>
<template #label>
{{dataStore.getProfileById(itemInfo.profile) ? dataStore.getProfileById(itemInfo.profile).fullName : "Kein Benutzer ausgewählt"}}
{{profileStore.getProfileById(itemInfo.profile) ? profileStore.getProfileById(itemInfo.profile).fullName : "Kein Benutzer ausgewählt"}}
</template>
</USelectMenu>
</UFormGroup>

View File

@@ -64,7 +64,7 @@
{{row.created_at ? dayjs(row.created_at).format("DD.MM.YY HH:mm") : ''}}
</template>
<template #user-data="{row}">
{{dataStore.profiles.find(i => i.id === row.user) ? dataStore.profiles.find(i => i.id === row.user).fullName : ""}}
{{profileStore.profiles.find(i => i.id === row.user) ? profileStore.profiles.find(i => i.id === row.user).fullName : ""}}
</template>
<template #project-data="{row}">
{{dataStore.projects.find(i => i.id === row.project) ? dataStore.projects.find(i => i.id === row.project).name : ""}}
@@ -86,6 +86,7 @@ definePageMeta({
})
const dataStore = useDataStore()
const profileStore = useProfileStore()
const router = useRouter()
defineShortcuts({