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} +

+ )} ))}