(
id: string,
opts: {
list?: string
status?: string
subject?: string
description?: string
owner?: string
clearOwner?: boolean
},
)
| 72 | } |
| 73 | |
| 74 | export async function taskUpdateHandler( |
| 75 | id: string, |
| 76 | opts: { |
| 77 | list?: string |
| 78 | status?: string |
| 79 | subject?: string |
| 80 | description?: string |
| 81 | owner?: string |
| 82 | clearOwner?: boolean |
| 83 | }, |
| 84 | ): Promise<void> { |
| 85 | const listId = opts.list || DEFAULT_LIST |
| 86 | const updates: Record<string, unknown> = {} |
| 87 | |
| 88 | if (opts.status) updates.status = opts.status |
| 89 | if (opts.subject) updates.subject = opts.subject |
| 90 | if (opts.description) updates.description = opts.description |
| 91 | if (opts.owner) updates.owner = opts.owner |
| 92 | if (opts.clearOwner) updates.owner = undefined |
| 93 | |
| 94 | const task = await updateTask(listId, id, updates) |
| 95 | if (!task) { |
| 96 | console.error(`Task not found: ${id}`) |
| 97 | process.exitCode = 1 |
| 98 | return |
| 99 | } |
| 100 | console.log(`Updated task ${id}: [${task.status}] ${task.subject}`) |
| 101 | } |
| 102 | |
| 103 | export async function taskDirHandler(opts: { list?: string }): Promise<void> { |
| 104 | const listId = opts.list || DEFAULT_LIST |
no test coverage detected