working leantime widget 43

This commit is contained in:
Alma 2025-04-12 14:49:30 +02:00
parent 5fd5b1edec
commit 6709db5c29

View File

@ -190,21 +190,23 @@ export async function GET(request: NextRequest) {
let statusType; let statusType;
let statusClass; let statusClass;
switch (task.status.toLowerCase()) { // Convert numeric status to string and handle accordingly
case 'new': const statusStr = task.status.toString();
switch (statusStr) {
case '1':
statusType = 'NEW'; statusType = 'NEW';
statusClass = 'bg-blue-100 text-blue-800'; statusClass = 'bg-blue-100 text-blue-800';
break; break;
case 'in_progress': case '2':
statusType = 'INPROGRESS'; statusType = 'INPROGRESS';
statusClass = 'bg-yellow-100 text-yellow-800'; statusClass = 'bg-yellow-100 text-yellow-800';
break; break;
case 'done': case '3':
statusType = 'DONE'; statusType = 'DONE';
statusClass = 'bg-green-100 text-green-800'; statusClass = 'bg-green-100 text-green-800';
break; break;
default: default:
statusType = 'NONE'; statusType = 'UNKNOWN';
statusClass = 'bg-gray-100 text-gray-800'; statusClass = 'bg-gray-100 text-gray-800';
} }