From ed57dd6ff1924ebbf0608dd4481db19064e1d86e Mon Sep 17 00:00:00 2001 From: Ruaridh Date: Tue, 4 Feb 2020 17:56:10 +0000 Subject: [PATCH] Auction rest endpoints bugfix (#363) * remove parameter brackets * remove more param brackets --- x/auction/client/rest/query.go | 6 +++--- x/auction/client/rest/tx.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x/auction/client/rest/query.go b/x/auction/client/rest/query.go index 73494c86..2c7f4eaa 100644 --- a/x/auction/client/rest/query.go +++ b/x/auction/client/rest/query.go @@ -15,9 +15,9 @@ import ( const restAuctionID = "auction-id" func registerQueryRoutes(cliCtx context.CLIContext, r *mux.Router) { - r.HandleFunc(fmt.Sprintf("/{%s}/auctions", types.ModuleName), queryAuctionsHandlerFn(cliCtx)).Methods("GET") - r.HandleFunc(fmt.Sprintf("/{%s}/auctions/{%s}", types.ModuleName, restAuctionID), queryAuctionHandlerFn(cliCtx)).Methods("GET") - r.HandleFunc(fmt.Sprintf("/{%s}/parameters", types.ModuleName), getParamsHandlerFn(cliCtx)).Methods("GET") + r.HandleFunc(fmt.Sprintf("/%s/auctions", types.ModuleName), queryAuctionsHandlerFn(cliCtx)).Methods("GET") + r.HandleFunc(fmt.Sprintf("/%s/auctions/{%s}", types.ModuleName, restAuctionID), queryAuctionHandlerFn(cliCtx)).Methods("GET") + r.HandleFunc(fmt.Sprintf("/%s/parameters", types.ModuleName), getParamsHandlerFn(cliCtx)).Methods("GET") } func queryAuctionHandlerFn(cliCtx context.CLIContext) http.HandlerFunc { diff --git a/x/auction/client/rest/tx.go b/x/auction/client/rest/tx.go index 03823216..7e09366b 100644 --- a/x/auction/client/rest/tx.go +++ b/x/auction/client/rest/tx.go @@ -15,7 +15,7 @@ import ( ) func registerTxRoutes(cliCtx context.CLIContext, r *mux.Router) { - r.HandleFunc(fmt.Sprintf("/{%s}/auctions/{%s}/bids", types.ModuleName, restAuctionID), bidHandlerFn(cliCtx)).Methods("POST") + r.HandleFunc(fmt.Sprintf("/%s/auctions/{%s}/bids", types.ModuleName, restAuctionID), bidHandlerFn(cliCtx)).Methods("POST") } type placeBidReq struct {