Fix task updated timestamp not being updated in the response after updating a task
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2020-10-25 12:59:28 +01:00
parent ffce9b51cc
commit 316ac0558b
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 9 additions and 0 deletions

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 {