From 423b2638aa37d24bf448dc5d4e4c86025ca29422 Mon Sep 17 00:00:00 2001 From: flfeders Date: Mon, 11 Mar 2024 15:07:18 +0100 Subject: [PATCH] Changes --- spaces/pages/workingtimes.vue | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/spaces/pages/workingtimes.vue b/spaces/pages/workingtimes.vue index 6f967b3..03375e0 100644 --- a/spaces/pages/workingtimes.vue +++ b/spaces/pages/workingtimes.vue @@ -19,13 +19,13 @@ const toast = useToast() const timeInfo = ref({ - user: "", + profile: "", start: "", end: null, notes: null, }) -const filterUser = ref(user.value.id || "") +const filterUser = ref(dataStore.getOwnProfile.id || "") const filteredRows = computed(() => { @@ -37,7 +37,7 @@ const filteredRows = computed(() => { times = times.filter(i => i.profile === filterUser.value) } } else if(dataStore.hasRight('viewOwnTimes')) { - times = times.filter(i => i.profile === user.value.id) + times = times.filter(i => i.profile === dataStore.getOwnProfile.id) } else { times = [] } @@ -49,7 +49,7 @@ const filteredRows = computed(() => { const itemInfo = ref({ - user: "", + profile: "", start: new Date(), end: "", notes: null, @@ -104,7 +104,7 @@ const configTimeMode = ref("create") const startTime = async () => { console.log("started") timeInfo.value = { - user: user.value.id, + profile: dataStore.getOwnProfile.id, start: dayjs().format("HH:mm:ssZ"), date: dayjs().format("YYYY-MM-DD"), tenant: dataStore.currentTenant, @@ -121,7 +121,7 @@ const startTime = async () => { } else if(data) { //timeInfo.value = data[0] await dataStore.fetchWorkingTimes() - runningTimeInfo.value = dataStore.times.find(time => time.profile === user.value.id && !time.end) + runningTimeInfo.value = dataStore.times.find(time => time.profile === dataStore.getOwnProfile.id && !time.end) } } @@ -153,8 +153,8 @@ const stopStartedTime = async () => { } } -if(dataStore.workingtimes.find(time => time.profile == user.value.id && !time.end)) { - runningTimeInfo.value = dataStore.workingtimes.find(time => time.profile == user.value.id && !time.end) +if(dataStore.workingtimes.find(time => time.profile == dataStore.getOwnProfile.id && !time.end)) { + runningTimeInfo.value = dataStore.workingtimes.find(time => time.profile == dataStore.getOwnProfile.id && !time.end) } @@ -227,7 +227,7 @@ const setState = async (newState) => { Start Erstellen @@ -271,10 +271,16 @@ const setState = async (newState) => {