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

@ -22,7 +22,6 @@ import (
"time"
"code.vikunja.io/api/pkg/db"
"code.vikunja.io/api/pkg/events"
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/user"
"code.vikunja.io/web"
@ -100,16 +99,7 @@ func (lt *LabelTask) Create(s *xorm.Session, auth web.Auth) (err error) {
return err
}
t, err := GetTaskByIDSimple(s, lt.TaskID)
if err != nil {
return err
}
doer, _ := user.GetFromAuth(auth)
err = events.Dispatch(&TaskUpdatedEvent{
Task: &t,
Doer: doer,
})
err = triggerTaskUpdatedEventForTaskID(s, auth, lt.TaskID)
if err != nil {
return err
}