From 6709db5c296f693b2328763c7e76491694e1cf91 Mon Sep 17 00:00:00 2001 From: Alma Date: Sat, 12 Apr 2025 14:49:30 +0200 Subject: [PATCH] working leantime widget 43 --- app/api/leantime/status-labels/route.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/api/leantime/status-labels/route.ts b/app/api/leantime/status-labels/route.ts index aa3c51de..6e1fb888 100644 --- a/app/api/leantime/status-labels/route.ts +++ b/app/api/leantime/status-labels/route.ts @@ -190,21 +190,23 @@ export async function GET(request: NextRequest) { let statusType; let statusClass; - switch (task.status.toLowerCase()) { - case 'new': + // Convert numeric status to string and handle accordingly + const statusStr = task.status.toString(); + switch (statusStr) { + case '1': statusType = 'NEW'; statusClass = 'bg-blue-100 text-blue-800'; break; - case 'in_progress': + case '2': statusType = 'INPROGRESS'; statusClass = 'bg-yellow-100 text-yellow-800'; break; - case 'done': + case '3': statusType = 'DONE'; statusClass = 'bg-green-100 text-green-800'; break; default: - statusType = 'NONE'; + statusType = 'UNKNOWN'; statusClass = 'bg-gray-100 text-gray-800'; }