Skip to content

Commit

Permalink
Remove redundant string conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
katzien authored Oct 5, 2020
1 parent 6b673e7 commit b3f917f
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions domain-hex/pkg/http/rest/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ func addBeer(s adding.Service) func(w http.ResponseWriter, r *http.Request, _ ht
// addBeerReview returns a handler for POST /beers/:id/reviews requests
func addBeerReview(s reviewing.Service) func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
_, err := strconv.Atoi(p.ByName("id"))
if err != nil {
http.Error(w, fmt.Sprintf("%s is not a valid Beer ID, it must be a number.", p.ByName("id")), http.StatusBadRequest)
return
}

var newReview reviewing.Review
decoder := json.NewDecoder(r.Body)

Expand Down

0 comments on commit b3f917f

Please sign in to comment.