Add scheduled tasks with a Project tab section and lead tools
This commit is contained in:
@@ -73,6 +73,20 @@ func (s *Store) PutWorkflow(ctx context.Context, name, from string, def api.Work
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = tx.ExecContext(ctx, `UPDATE schedules SET workflow = ? WHERE workflow = ?`, name, from)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
repointed, err := querySchedules(ctx, tx, `WHERE workflow = ?`, name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, sc := range repointed {
|
||||
err = emit(api.Event{Kind: "schedule.saved", ProjectId: &sc.ProjectId, Actor: actor, Payload: ToPayload(sc)})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
err = emit(api.Event{Kind: "workflow.deleted", Actor: actor, Payload: map[string]any{"name": from}})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user