Widget Devoir Finition

This commit is contained in:
alma 2026-01-24 16:00:17 +01:00
parent b3ce739153
commit 6af464eb70

View File

@ -28,6 +28,7 @@ interface Task {
editFrom?: string; editFrom?: string;
type?: string; type?: string;
dependingTicketId?: number | null; dependingTicketId?: number | null;
source?: 'leantime' | 'twenty-crm';
} }
interface ProjectSummary { interface ProjectSummary {
@ -145,7 +146,8 @@ export function Duties() {
status: t.status, status: t.status,
statusType: typeof t.status, statusType: typeof t.status,
}))); })));
leantimeTasks = leantimeData; // Mark tasks with source
leantimeTasks = leantimeData.map((t: Task) => ({ ...t, source: 'leantime' as const }));
} }
} else { } else {
console.warn('Failed to fetch Leantime tasks:', leantimeResponse); console.warn('Failed to fetch Leantime tasks:', leantimeResponse);
@ -156,7 +158,8 @@ export function Duties() {
if (twentyCrmResponse.status === 'fulfilled' && twentyCrmResponse.value.ok) { if (twentyCrmResponse.status === 'fulfilled' && twentyCrmResponse.value.ok) {
const twentyCrmData = await twentyCrmResponse.value.json(); const twentyCrmData = await twentyCrmResponse.value.json();
if (Array.isArray(twentyCrmData)) { if (Array.isArray(twentyCrmData)) {
twentyCrmTasks = twentyCrmData; // Mark tasks with source
twentyCrmTasks = twentyCrmData.map((t: Task) => ({ ...t, source: 'twenty-crm' as const }));
} }
} else { } else {
console.warn('Failed to fetch Twenty CRM tasks:', twentyCrmResponse); console.warn('Failed to fetch Twenty CRM tasks:', twentyCrmResponse);