diff options
Diffstat (limited to 'internal/store')
| -rw-r--r-- | internal/store/native_tasks.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/store/native_tasks.go b/internal/store/native_tasks.go index d4cc896..3bd87cb 100644 --- a/internal/store/native_tasks.go +++ b/internal/store/native_tasks.go @@ -125,12 +125,16 @@ func (s *Store) CreateNativeTask(task models.Task) error { } // UpdateNativeTask updates a native task's content and description. +// Returns ErrNativeTaskNotFound if id doesn't match any row. func (s *Store) UpdateNativeTask(id, content, description string) error { - _, err := s.db.Exec(` + result, err := s.db.Exec(` UPDATE native_tasks SET content = ?, description = ?, updated_at = CURRENT_TIMESTAMP WHERE id = ? `, content, description, id) - return err + if err != nil { + return err + } + return checkRowsAffected(result) } // UpdateNativeTaskDescription updates only a native task's description, leaving content untouched. |
