feat(helpdesk): enable oauth2 token flow and tenant-scoped cache

This commit is contained in:
2026-04-02 21:46:01 +02:00
parent a37486c0e3
commit 8de67fa882
9 changed files with 267 additions and 21 deletions

View File

@@ -539,6 +539,17 @@ function init(container) {
updateKpi('open-tickets', String(summaryResult.open ?? 0));
updateKpi('last-activity', summaryResult.last_activity ? formatDate(summaryResult.last_activity) : '—');
updateBadge('tab-badge-tickets', summaryResult.total ?? 0);
} else if (Array.isArray(allTickets)) {
// Fallback: calculate from fetched overview tickets when summary endpoint unavailable
const openCount = allTickets.filter(tk => isOpen(tk.Ticket_State || '')).length;
updateKpi('open-tickets', String(openCount));
let maxDate = '';
for (const tk of allTickets) {
const d = tk.Last_Activity_Date || '';
if (d > maxDate && d !== '0001-01-01T00:00:00Z') maxDate = d;
}
updateKpi('last-activity', maxDate ? formatDate(maxDate) : '—');
updateBadge('tab-badge-tickets', ticketsResult.total ?? allTickets.length);
}
if (contactsResult.ok) {