From 26fda2e4199c67b98930a789d476df85d06ae96a Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 2 Jan 2026 16:17:46 +0100 Subject: [PATCH] Fix: Brug korrekt funktion og setup til at vise specifik time entry i wizard --- app/timetracking/frontend/wizard.html | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/app/timetracking/frontend/wizard.html b/app/timetracking/frontend/wizard.html index c6da4fc..e53b259 100644 --- a/app/timetracking/frontend/wizard.html +++ b/app/timetracking/frontend/wizard.html @@ -398,13 +398,34 @@ const entry = await response.json(); + currentEntry = entry; + currentCaseId = entry.case_id; + + // Fetch ALL pending timelogs in this case + if (entry.case_id) { + const caseResponse = await fetch(`/api/v1/timetracking/wizard/case/${entry.case_id}/entries`); + if (caseResponse.ok) { + window.currentCaseEntries = await caseResponse.json(); + } else { + window.currentCaseEntries = [entry]; + } + } else { + window.currentCaseEntries = [entry]; + } + // Show the entry - displayTimeEntry({ + displayCaseEntries({ time_entry: entry, - has_next: true, // Assume there might be more + has_next: true, remaining_count: 1 }); + await loadCustomerContext(); + await loadCaseContext(); + + document.getElementById('loading-state').classList.add('d-none'); + document.getElementById('time-entry-container').classList.remove('d-none'); + } catch (error) { console.error('Error loading specific entry:', error); showToast('Kunne ikke indlæse tidsregistrering', 'danger');