Fix: Load specific entry viser nu korrekt entry selv hvis den ikke er pending
This commit is contained in:
parent
0b06276963
commit
1c12014c5a
@ -401,15 +401,19 @@
|
||||
currentEntry = entry;
|
||||
currentCaseId = entry.case_id;
|
||||
|
||||
// Fetch ALL pending timelogs in this case
|
||||
if (entry.case_id) {
|
||||
// Only fetch other case entries if this entry is pending
|
||||
// Otherwise just show this single entry
|
||||
if (entry.status === 'pending' && entry.case_id) {
|
||||
const caseResponse = await fetch(`/api/v1/timetracking/wizard/case/${entry.case_id}/entries`);
|
||||
if (caseResponse.ok) {
|
||||
window.currentCaseEntries = await caseResponse.json();
|
||||
const caseEntries = await caseResponse.json();
|
||||
// Make sure our entry is in the list (it should be since it's pending)
|
||||
window.currentCaseEntries = caseEntries;
|
||||
} else {
|
||||
window.currentCaseEntries = [entry];
|
||||
}
|
||||
} else {
|
||||
// Entry is not pending - just show this one entry
|
||||
window.currentCaseEntries = [entry];
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user