From e7e387dd561fb21912ee7c0932d7f935f417cce9 Mon Sep 17 00:00:00 2001 From: Alma Date: Sat, 12 Apr 2025 16:07:37 +0200 Subject: [PATCH] working leantime widget 63 --- components/flow.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/components/flow.tsx b/components/flow.tsx index fd56aac0..a9b69362 100644 --- a/components/flow.tsx +++ b/components/flow.tsx @@ -16,7 +16,11 @@ interface Task { date: string; editFrom: string; editTo: string; - editorId: string; + editor: { + id: string; + firstname: string; + lastname: string; + }; authorFirstname?: string; authorLastname?: string; tags?: string; @@ -109,6 +113,7 @@ export function Flow() { const data = await response.json(); if (!data.tasks || !Array.isArray(data.tasks)) { + console.warn('No tasks found in response:', data); setTasks([]); return; } @@ -118,7 +123,7 @@ export function Flow() { .filter((task: Task) => task.headline && typeof task.headline === 'string' && - task.editorId // Only show tasks assigned to the current user + task.editor // Only show tasks with an editor ) .sort((a: Task, b: Task) => getDateToSort(a) - getDateToSort(b)); @@ -176,6 +181,11 @@ export function Flow() { Due: {formatDate(task.dateToFinish)}

)} + {task.editor && ( +

+ Assigned to: {task.editor.firstname} {task.editor.lastname} +

+ )} ))}