fix(typesense): correctly index assignee changes on tasks
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This change fixes a bug where adding or removing an assignee to a task would not update the index in Typesense, causing filter queries for that assignee to return incorrect data. This was caused by the events being dispatched by the task update process not containing all the data. Resolves https://github.com/go-vikunja/vikunja/issues/255
This commit is contained in:
parent
e56b2232bb
commit
f131289d32
@ -189,11 +189,18 @@ func (la *TaskAssginee) Delete(s *xorm.Session, a web.Auth) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
return events.Dispatch(&TaskAssigneeDeletedEvent{
|
||||
err = events.Dispatch(&TaskAssigneeDeletedEvent{
|
||||
Task: &task,
|
||||
Assignee: &user.User{ID: la.UserID},
|
||||
Doer: doer,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return events.Dispatch(&TaskUpdatedEvent{
|
||||
Task: &task,
|
||||
Doer: doer,
|
||||
})
|
||||
}
|
||||
|
||||
// Create adds a new assignee to a task
|
||||
@ -281,7 +288,7 @@ func (t *Task) addNewAssigneeByID(s *xorm.Session, newAssigneeID int64, project
|
||||
return err
|
||||
}
|
||||
err = events.Dispatch(&TaskUpdatedEvent{
|
||||
Task: t,
|
||||
Task: &task,
|
||||
Doer: doer,
|
||||
})
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user