feat(time): add span-based attendance tracking under 2.0
This commit is contained in:
@@ -7,7 +7,7 @@ const setupPage = async () => {
|
||||
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")
|
||||
const openSpan = (spans || []).find((s) => !s.endedAt && ["work", "pause"].includes(s.type))
|
||||
if (openSpan) return { profile: profile.id }
|
||||
} catch (e) {
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user