From 316ac0558b62203aa12c5e1b37ee0f8d650d2d22 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 25 Oct 2020 12:59:28 +0100 Subject: [PATCH] Fix task updated timestamp not being updated in the response after updating a task --- pkg/models/tasks.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/models/tasks.go b/pkg/models/tasks.go index a779f52a3..87af0182e 100644 --- a/pkg/models/tasks.go +++ b/pkg/models/tasks.go @@ -917,6 +917,15 @@ func (t *Task) Update() (err error) { _ = s.Rollback() return err } + // Get the task updated timestamp in a new struct - if we'd just try to put it into t which we already have, it + // would still contain the old updated date. + nt := &Task{} + _, err = s.ID(t.ID).Get(nt) + if err != nil { + _ = s.Rollback() + return err + } + t.Updated = nt.Updated err = updateListLastUpdatedS(s, &List{ID: t.ListID}) if err != nil {