Corrected Error in Dashboard
This commit is contained in:
24
components/noAutoLoad/displayPresentProfiles.vue
Normal file
24
components/noAutoLoad/displayPresentProfiles.vue
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<script setup>
|
||||||
|
const supabase = useSupabaseClient()
|
||||||
|
const profileStore = useProfileStore()
|
||||||
|
|
||||||
|
const workingtimes = ref([])
|
||||||
|
const setupPage = async () => {
|
||||||
|
workingtimes.value = (await supabase.from("workingtimes").select().eq("tenant",profileStore.currentTenant).is("endDate",null)).data
|
||||||
|
}
|
||||||
|
|
||||||
|
setupPage()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div v-if="workingtimes.length > 0">
|
||||||
|
<p v-for="time in workingtimes"><UIcon name="i-heroicons-check"/> {{profileStore.getProfileById(time.profile).fullName}}</p>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<p>Keine Mitarbeiter anwesend</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -17,9 +17,8 @@
|
|||||||
<UDashboardCard
|
<UDashboardCard
|
||||||
class="mt-3"
|
class="mt-3"
|
||||||
title="Anwesenheiten"
|
title="Anwesenheiten"
|
||||||
v-if="dataStore.getStartedWorkingTimes().length > 0"
|
|
||||||
>
|
>
|
||||||
<p v-for="time in dataStore.getStartedWorkingTimes()"><UIcon name="i-heroicons-check"/>{{profileStore.getProfileById(time.profile).fullName}}</p>
|
<display-present-profiles/>
|
||||||
</UDashboardCard>
|
</UDashboardCard>
|
||||||
|
|
||||||
|
|
||||||
@@ -45,6 +44,8 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
||||||
|
import DisplayPresentProfiles from "~/components/noAutoLoad/displayPresentProfiles.vue";
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: "auth"
|
middleware: "auth"
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user