Supabase Removals Frontend
This commit is contained in:
@@ -32,15 +32,7 @@ const default_data = {
|
||||
const newProjectDescription = ref(data|| default_data.value);
|
||||
|
||||
const saveProjectDescription = async () => {
|
||||
//Update Project Description
|
||||
/*const {data:updateData,error:updateError} = await supabase
|
||||
.from("projects")
|
||||
.update({description: newProjectDescription.value})
|
||||
.eq('id',currentProject.id)
|
||||
.select()
|
||||
|
||||
console.log(updateData)
|
||||
console.log(updateError)*/
|
||||
|
||||
|
||||
|
||||
@@ -61,4 +53,4 @@ const saveProjectDescription = async () => {
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user