feat(helpdesk): enable oauth2 token flow and tenant-scoped cache
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user