Supabase Removals Frontend

This commit is contained in:
2026-02-14 12:48:59 +01:00
parent 053f184a33
commit 55699da42c
28 changed files with 135 additions and 222 deletions

View File

@@ -1,10 +1,20 @@
<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
const profiles = profileStore.profiles || []
const checks = await Promise.all(profiles.map(async (profile) => {
try {
const spans = await useNuxtApp().$api(`/api/staff/time/spans?targetUserId=${profile.user_id || profile.id}`)
const openSpan = (spans || []).find((s) => !s.endedAt && s.type === "work")
if (openSpan) return { profile: profile.id }
} catch (e) {
return null
}
return null
}))
workingtimes.value = checks.filter(Boolean)
}
setupPage()
@@ -21,4 +31,4 @@ setupPage()
<style scoped>
</style>
</style>