fix: error handling of task status settings

This commit is contained in:
shenysun
2025-05-15 21:18:30 +08:00
parent 09d839fff5
commit 97bf01a0ac
8 changed files with 91 additions and 3 deletions

View File

@@ -17,6 +17,12 @@ async function updateSingleTaskStatus(
data,
showUi = true
) {
if (!isValidTaskStatus(newStatus)) {
throw new Error(
`Error: Invalid status value: ${newStatus}. Use one of: ${TASK_STATUS_OPTIONS.join(', ')}`
);
}
// Check if it's a subtask (e.g., "1.2")
if (taskIdInput.includes('.')) {
const [parentId, subtaskId] = taskIdInput