From 81537f882f4e8d8c41cd0a3851c69622895881cf Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Mon, 8 Apr 2019 16:11:19 +0200 Subject: [PATCH] gateway: fix runs url to plural --- internal/services/gateway/api/client.go | 2 +- internal/services/gateway/gateway.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/services/gateway/api/client.go b/internal/services/gateway/api/client.go index e4ff720..6551d72 100644 --- a/internal/services/gateway/api/client.go +++ b/internal/services/gateway/api/client.go @@ -312,7 +312,7 @@ func (c *Client) DeleteUserToken(ctx context.Context, userName, tokenName string func (c *Client) GetRun(ctx context.Context, runID string) (*RunResponse, *http.Response, error) { run := new(RunResponse) - resp, err := c.getParsedResponse(ctx, "GET", fmt.Sprintf("/run/%s", runID), nil, jsonContent, nil, run) + resp, err := c.getParsedResponse(ctx, "GET", fmt.Sprintf("/runs/%s", runID), nil, jsonContent, nil, run) return run, resp, err } diff --git a/internal/services/gateway/gateway.go b/internal/services/gateway/gateway.go index d828023..f4f2361 100644 --- a/internal/services/gateway/gateway.go +++ b/internal/services/gateway/gateway.go @@ -260,9 +260,9 @@ func (g *Gateway) Run(ctx context.Context) error { apirouter.Handle("/orgs/{orgname}", authForcedHandler(orgByNameHandler)).Methods("GET") apirouter.Handle("/orgs/{orgname}", authForcedHandler(deleteOrgHandler)).Methods("DELETE") - apirouter.Handle("/run/{runid}", authForcedHandler(runHandler)).Methods("GET") - apirouter.Handle("/run/{runid}/actions", authForcedHandler(runActionsHandler)).Methods("PUT") - apirouter.Handle("/run/{runid}/task/{taskid}", authForcedHandler(runtaskHandler)).Methods("GET") + apirouter.Handle("/runs/{runid}", authForcedHandler(runHandler)).Methods("GET") + apirouter.Handle("/runs/{runid}/actions", authForcedHandler(runActionsHandler)).Methods("PUT") + apirouter.Handle("/runs/{runid}/tasks/{taskid}", authForcedHandler(runtaskHandler)).Methods("GET") apirouter.Handle("/runs", authForcedHandler(runsHandler)).Methods("GET") router.Handle("/login", loginUserHandler).Methods("POST")