1
0

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:
kolaente 2024-07-12 13:30:38 +02:00
parent e5e0db1f6a
commit 51040cf1af
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B

View File

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