UpdateSyncedTaskFile updates an existing synced task file.
(filePath string, mapped MappedTask)
| 31 | |
| 32 | // UpdateSyncedTaskFile updates an existing synced task file. |
| 33 | func UpdateSyncedTaskFile(filePath string, mapped MappedTask) error { |
| 34 | req := taskfile.UpdateRequest{ |
| 35 | Status: &mapped.Status, |
| 36 | Title: &mapped.Title, |
| 37 | } |
| 38 | if mapped.Priority != "" { |
| 39 | req.Priority = &mapped.Priority |
| 40 | } |
| 41 | if mapped.Owner != "" { |
| 42 | req.Owner = &mapped.Owner |
| 43 | } |
| 44 | if len(mapped.Tags) > 0 { |
| 45 | req.Tags = &mapped.Tags |
| 46 | } |
| 47 | if mapped.Description != "" { |
| 48 | req.Body = &mapped.Description |
| 49 | } |
| 50 | return taskfile.UpdateTaskFile(filePath, req) |
| 51 | } |
| 52 | |
| 53 | func renderTaskFile(id string, mapped MappedTask, externalID, sourceName string) string { |
| 54 | var b strings.Builder |