diff options
| author | Omni Worker <bot@omni.agent> | 2025-11-21 22:59:58 -0500 |
|---|---|---|
| committer | Omni Worker <bot@omni.agent> | 2025-11-21 22:59:58 -0500 |
| commit | 57635a9fbe5e217acd5ad609d7d9b97ce5cef232 (patch) | |
| tree | f2285e63a80e3e7f370a99c4826230be4e9825b2 /Omni/Task | |
| parent | 6f4b2c97a24967508f3970b46999052fd1f44e67 (diff) | |
feat(task): support updating deps in task update
Amp-Thread-ID:
https://ampcode.com/threads/T-79499d9e-f4f4-40de-893c-524c32a45483
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'Omni/Task')
| -rw-r--r-- | Omni/Task/Core.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs index bab1912..9e4d2b4 100644 --- a/Omni/Task/Core.hs +++ b/Omni/Task/Core.hs @@ -343,15 +343,15 @@ createTask title taskType parent namespace priority deps description = pure task -- Update task status -updateTaskStatus :: Text -> Status -> IO () -updateTaskStatus tid newStatus = +updateTaskStatus :: Text -> Status -> [Dependency] -> IO () +updateTaskStatus tid newStatus newDeps = withTaskWriteLock <| do tasks <- loadTasksInternal now <- getCurrentTime let updatedTasks = map updateIfMatch tasks updateIfMatch t = if matchesId (taskId t) tid - then t {taskStatus = newStatus, taskUpdatedAt = now} + then t {taskStatus = newStatus, taskUpdatedAt = now, taskDependencies = if null newDeps then taskDependencies t else newDeps} else t -- Rewrite the entire file (simple approach for MVP) tasksFile <- getTasksFilePath |
