Changes in workingtimes

This commit is contained in:
2025-01-21 09:54:05 +01:00
parent 33818033a4
commit 9efa596059
2 changed files with 22 additions and 6 deletions

View File

@@ -23,6 +23,11 @@ const setupPage = () => {
//setStartEnd()
}
oldItemInfo.value = itemInfo.value
if(route.query) {
if(route.query.profile) itemInfo.value.profile = route.query.profile
}
}
/*const setStartEnd = () => {

View File

@@ -12,16 +12,27 @@ const dataStore = useDataStore()
const profileStore = useProfileStore()
const supabase = useSupabaseClient()
const router = useRouter()
const route = useRoute()
const filterUser = ref(profileStore.activeProfile.id || "")
const workingtimes = ref([])
const setupPage = async () => {
if(route.query) {
if(route.query.profile) filterUser.value = route.query.profile
}
workingtimes.value = (await supabase.from("workingtimes").select().eq("profile",filterUser.value).order("startDate",{ascending: false})).data
}
const changeFilterUser = async () => {
await router.push(`/workingtimes/?profile=${filterUser.value}`)
await setupPage()
}
setupPage()
@@ -147,9 +158,9 @@ const setEndDate = (row) => {
<UDashboardNavbar title="Anwesenheiten">
<template #right>
<UButton
@click="router.push(`/workingtimes/edit`)"
@click="router.push(`/workingtimes/edit?profile=${filterUser}`)"
>
Erstellen
+ Anwesenheit
</UButton>
</template>
</UDashboardNavbar>
@@ -161,7 +172,7 @@ const setEndDate = (row) => {
option-attribute="fullName"
value-attribute="id"
v-model="filterUser"
@change="setupPage"
@change="changeFilterUser"
>
<template #label>
{{profileStore.getProfileById(filterUser) ? profileStore.getProfileById(filterUser).fullName : "Kein Benutzer ausgewählt"}}