Signal the lead when a task is created, except tasks it created

This commit is contained in:
Ian Gulliver
2026-10-15 10:12:44 -07:00
parent fdd005b591
commit 184bfe429e
15 changed files with 112 additions and 29 deletions
+2 -2
View File
@@ -506,7 +506,7 @@ func (s *Store) GetProject(ctx context.Context, id string) (api.Project, error)
return p, err
}
func (s *Store) CreateTask(ctx context.Context, t api.Task) error {
func (s *Store) CreateTask(ctx context.Context, t api.Task, actor string) error {
todoItem := ""
if t.TodoItem != nil {
todoItem = *t.TodoItem
@@ -519,7 +519,7 @@ func (s *Store) CreateTask(ctx context.Context, t api.Task) error {
if err != nil {
return err
}
return emit(api.Event{Kind: "task.created", ProjectId: &t.ProjectId, TaskId: &t.Id, Actor: t.CreatedBy, Payload: ToPayload(t)})
return emit(api.Event{Kind: "task.created", ProjectId: &t.ProjectId, TaskId: &t.Id, Actor: actor, Payload: ToPayload(t)})
})
}