fix: fixed findTaskById and tests

This commit is contained in:
Shrey Paharia
2025-05-07 11:17:55 +05:30
parent 07a710d88e
commit e917fd16c0
2 changed files with 16 additions and 16 deletions

View File

@@ -349,9 +349,6 @@ function findTaskById(
return { task: null, originalSubtaskCount: null };
}
let taskResult = null;
let originalSubtaskCount = null;
// Check if it's a subtask ID (e.g., "1.2")
if (typeof taskId === 'string' && taskId.includes('.')) {
// If looking for a subtask, statusFilter doesn't apply directly here.
@@ -380,9 +377,12 @@ function findTaskById(
addComplexityToTask(subtask, complexityReport);
}
taskResult = subtask;
return { task: subtask || null, originalSubtaskCount: null };
}
let taskResult = null;
let originalSubtaskCount = null;
// Find the main task
const id = parseInt(taskId, 10);
const task = tasks.find((t) => t.id === id) || null;