Fix task updated timestamp not being updated in the response after updating a task

This commit is contained in:
kolaente 2020-10-25 12:59:28 +01:00
parent ffce9b51cc
commit 316ac0558b
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -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 {