Skip to content

Commit

Permalink
Merge pull request #91 from trickest/fix/private-workflow-endpoint
Browse files Browse the repository at this point in the history
Update endpoint for private workflow requests
  • Loading branch information
PolovinaD authored Oct 3, 2023
2 parents f455d22 + 9a6fb54 commit 23e8575
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func CreateWorkflow(name, description string, spaceID, projectID uuid.UUID, dele
os.Exit(0)
}

resp := request.Trickest.Post().Body(data).DoF("library/workflow/?vault=%s", util.GetVault())
resp := request.Trickest.Post().Body(data).DoF("workflow/?vault=%s", util.GetVault())
if resp == nil {
fmt.Println("Error: Couldn't create workflow.")
os.Exit(0)
Expand Down
2 changes: 1 addition & 1 deletion cmd/execute/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func updateWorkflow(workflow *types.Workflow, deleteProjectOnError bool) {
os.Exit(0)
}

resp := request.Trickest.Patch().Body(data).DoF("library/workflow/%s/", workflow.ID)
resp := request.Trickest.Patch().Body(data).DoF("workflow/%s/", workflow.ID)
if resp == nil {
fmt.Println("Error: Couldn't update workflow!")
os.Exit(0)
Expand Down
7 changes: 5 additions & 2 deletions cmd/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ func getSpaceByID(id uuid.UUID) *types.SpaceDetailed {
}

func GetWorkflows(projectID, spaceID uuid.UUID, search string, library bool) []types.WorkflowListResponse {
urlReq := "library/workflow/"
urlReq := "workflow/"
if library {
urlReq = "library/" + urlReq
}
urlReq += "?page_size=" + strconv.Itoa(math.MaxInt)
if !library {
urlReq += "&vault=" + util.GetVault().String()
Expand Down Expand Up @@ -259,7 +262,7 @@ func GetWorkflows(projectID, spaceID uuid.UUID, search string, library bool) []t
}

func GetWorkflowByID(id uuid.UUID) *types.Workflow {
resp := request.Trickest.Get().DoF("library/workflow/%s/", id.String())
resp := request.Trickest.Get().DoF("workflow/%s/", id.String())
if resp == nil {
fmt.Println("Error: Couldn't get workflow by ID!")
os.Exit(0)
Expand Down

0 comments on commit 23e8575

Please sign in to comment.