fix(time-tracking) : return empty collection instead of 404 for active timer endpoint
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,8 +24,9 @@ export function useTimeEntryService() {
|
||||
|
||||
async function getActive(): Promise<TimeEntry | null> {
|
||||
try {
|
||||
const result = await api.get<TimeEntry | null>('/time_entries/active', {}, { toast: false })
|
||||
return result ?? null
|
||||
const data = await api.get<HydraCollection<TimeEntry>>('/time_entries/active', {}, { toast: false })
|
||||
const members = extractHydraMembers(data)
|
||||
return members[0] ?? null
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user