Signal the lead when a task is created, except tasks it created
This commit is contained in:
@@ -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)})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user