fix: error handling of task status settings (#523)

* fix: error handling of task status settings

* fix: update import path

---------

Co-authored-by: shenysun <shenysun@163.com>
This commit is contained in:
Ralph Khreish
2025-05-16 15:47:01 +02:00
committed by GitHub
parent ed17cb0e0a
commit da317f2607
8 changed files with 92 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
import chalk from 'chalk';
import { log } from '../utils.js';
import { isValidTaskStatus } from '../../../src/constants/task-status.js';
/**
* Update the status of a single task
@@ -17,6 +18,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