fix(kanban): dispatch task updated event when task position is updated
This fixes a bug where a task would not be indexed in Typesense when its position changed.
This commit is contained in:
parent
e5e0db1f6a
commit
51040cf1af
@ -20,6 +20,8 @@ import (
|
||||
"math"
|
||||
|
||||
"code.vikunja.io/api/pkg/events"
|
||||
"code.vikunja.io/api/pkg/user"
|
||||
|
||||
"code.vikunja.io/web"
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
@ -108,7 +110,16 @@ func (tp *TaskPosition) Update(s *xorm.Session, a web.Auth) (err error) {
|
||||
return RecalculateTaskPositions(s, view, a)
|
||||
}
|
||||
|
||||
return
|
||||
task, err := GetTaskByIDSimple(s, tp.TaskID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
doer, _ := user.GetFromAuth(a)
|
||||
return events.Dispatch(&TaskUpdatedEvent{
|
||||
Task: &task,
|
||||
Doer: doer,
|
||||
})
|
||||
}
|
||||
|
||||
func RecalculateTaskPositions(s *xorm.Session, view *ProjectView, a web.Auth) (err error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user