Introduced ProfileStore
Corrected All Links to DataStore
This commit is contained in:
@@ -15,6 +15,7 @@ dayjs.extend(isSameOrBefore)
|
||||
|
||||
|
||||
const dataStore = useDataStore()
|
||||
const profileStore = useProfileStore()
|
||||
const supabase = useSupabaseClient()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
@@ -27,7 +28,7 @@ const absencerequests = ref([])
|
||||
|
||||
|
||||
const setupPage = async () => {
|
||||
if(route.params.id) itemInfo.value = dataStore.getProfileById(route.params.id)
|
||||
if(route.params.id) itemInfo.value = profileStore.getProfileById(route.params.id)
|
||||
if(itemInfo.value.id) oldItemInfo.value = JSON.parse(JSON.stringify(itemInfo.value))
|
||||
workingtimes.value = (await supabase.from("workingtimes").select().eq("profile",itemInfo.value.id).order("startDate",{ascending:false})).data
|
||||
absencerequests.value = (await supabase.from("absencerequests").select().eq("user",itemInfo.value.id).order("start",{ascending: false})).data
|
||||
@@ -177,13 +178,13 @@ const getDuration = (time) => {
|
||||
const showDocument = ref(false)
|
||||
const uri = ref("")
|
||||
const generateDocument = async () => {
|
||||
const ownTenant = dataStore.ownTenant
|
||||
const ownTenant = profileStore.ownTenant
|
||||
const path = ownTenant.letterheadConfig["workingTimesEvaluation"]
|
||||
|
||||
const {data,error} = await supabase.storage.from("files").download(path)
|
||||
|
||||
uri.value = await useCreateWorkingTimesPdf({
|
||||
profile: dataStore.getProfileById(route.params.id).fullName,
|
||||
profile: profileStore.getProfileById(route.params.id).fullName,
|
||||
...workingTimeInfo.value}, await data.arrayBuffer())
|
||||
//alert(uri.value)
|
||||
showDocument.value = true
|
||||
@@ -345,7 +346,7 @@ changeRange()
|
||||
]"
|
||||
>
|
||||
<template #profile-data="{row}">
|
||||
{{dataStore.profiles.find(profile => profile.id === row.profile) ? dataStore.profiles.find(profile => profile.id === row.profile).fullName : row.profile }}
|
||||
{{profileStore.profiles.find(profile => profile.id === row.profile) ? profileStore.profiles.find(profile => profile.id === row.profile).fullName : row.profile }}
|
||||
</template>
|
||||
<template #approved-data="{row}">
|
||||
<span v-if="row.approved" class="text-primary-500">Ja</span>
|
||||
|
||||
Reference in New Issue
Block a user