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"
|
"math"
|
||||||
|
|
||||||
"code.vikunja.io/api/pkg/events"
|
"code.vikunja.io/api/pkg/events"
|
||||||
|
"code.vikunja.io/api/pkg/user"
|
||||||
|
|
||||||
"code.vikunja.io/web"
|
"code.vikunja.io/web"
|
||||||
"xorm.io/xorm"
|
"xorm.io/xorm"
|
||||||
)
|
)
|
||||||
@ -108,9 +110,18 @@ func (tp *TaskPosition) Update(s *xorm.Session, a web.Auth) (err error) {
|
|||||||
return RecalculateTaskPositions(s, view, a)
|
return RecalculateTaskPositions(s, view, a)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task, err := GetTaskByIDSimple(s, tp.TaskID)
|
||||||
|
if err != nil {
|
||||||
return
|
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) {
|
func RecalculateTaskPositions(s *xorm.Session, view *ProjectView, a web.Auth) (err error) {
|
||||||
|
|
||||||
// Using the collection so that we get all tasks, even in cases where we're dealing with a saved filter underneath
|
// Using the collection so that we get all tasks, even in cases where we're dealing with a saved filter underneath
|
||||||
|
Loading…
x
Reference in New Issue
Block a user