Skip to content

Commit

Permalink
Update URL endpoint in controller-client
Browse files Browse the repository at this point in the history
The "/execute" path is added to the endpoint URL in controller-client.go. This commit changes the formatted url to include "/execute", providing a specific endpoint for POST requests.
  • Loading branch information
PiotrFerenc committed Apr 30, 2024
1 parent 8483864 commit 904cc56
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions web/modules/editor/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ func CreateEditorHandler() func(c echo.Context) error {
func ExecutePipelineHandler(client controllers.ControllerClient) func(c echo.Context) error {
return func(c echo.Context) error {

var pipe types.Pipeline
pipe := new(types.Pipeline)

if err := c.Bind(&pipe); err != nil {
if err := c.Bind(pipe); err != nil {
return c.Render(http.StatusBadRequest, "error.html", map[string]interface{}{
"error": err.Error(),
})
Expand All @@ -52,7 +52,7 @@ func ExecutePipelineHandler(client controllers.ControllerClient) func(c echo.Con
})
}

result, err := client.Execute(pipe)
result, err := client.Execute(*pipe)
if err != nil {
return c.Render(http.StatusBadRequest, "error.html", map[string]interface{}{
"error": err,
Expand Down Expand Up @@ -85,13 +85,13 @@ func initActions() (map[string]string, error) {
func initCommand() ([]byte, error) {
initCommand := types.Pipeline{
Parameters: map[string]interface{}{
"my-console.text": "hallo word",
"myconsole.text": "hallo word",
},
Tasks: []types.Task{
types.Task{
Sequence: 1,
Action: "console",
Name: "my-console",
Name: "myconsole",
},
},
}
Expand Down

0 comments on commit 904cc56

Please sign in to comment.