1
0

feat(event): simplify dispatching task updated event from only a task id

(cherry picked from commit 5a0d1f1dc6430f80788ae4cfacbe7da58f704841)
This commit is contained in:
kolaente
2024-08-29 15:18:03 +02:00
parent f812a67269
commit 7b804efbe2
3 changed files with 16 additions and 23 deletions

View File

@ -20,8 +20,6 @@ import (
"math"
"code.vikunja.io/api/pkg/events"
"code.vikunja.io/api/pkg/user"
"code.vikunja.io/web"
"xorm.io/xorm"
)
@ -110,16 +108,7 @@ func (tp *TaskPosition) Update(s *xorm.Session, a web.Auth) (err error) {
return RecalculateTaskPositions(s, view, a)
}
task, err := GetTaskByIDSimple(s, tp.TaskID)
if err != nil {
return
}
doer, _ := user.GetFromAuth(a)
return events.Dispatch(&TaskUpdatedEvent{
Task: &task,
Doer: doer,
})
return triggerTaskUpdatedEventForTaskID(s, a, tp.TaskID)
}
func RecalculateTaskPositions(s *xorm.Session, view *ProjectView, a web.Auth) (err error) {