Skip to content

Commit

Permalink
fix: aborting execution via endpoint without test workflow name (#5143)
Browse files Browse the repository at this point in the history
  • Loading branch information
rangoo94 committed Mar 14, 2024
1 parent 2e89728 commit 39b7064
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/tcl/apitcl/v1/testworkflowexecutions.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,13 @@ func (s *apiTCL) AbortTestWorkflowExecutionHandler() fiber.Handler {
executionID := c.Params("executionID")
errPrefix := fmt.Sprintf("failed to abort test workflow execution '%s'", executionID)

// TODO: Fetch execution from database
execution, err := s.TestWorkflowResults.GetByNameAndTestWorkflow(ctx, executionID, name)
var execution testkube.TestWorkflowExecution
var err error
if name == "" {
execution, err = s.TestWorkflowResults.Get(ctx, executionID)
} else {
execution, err = s.TestWorkflowResults.GetByNameAndTestWorkflow(ctx, executionID, name)
}
if err != nil {
return s.ClientError(c, errPrefix, err)
}
Expand Down

0 comments on commit 39b7064

Please sign in to comment.