Skip to content

Commit

Permalink
Fixed claim offer api.
Browse files Browse the repository at this point in the history
  • Loading branch information
cscatolini committed Mar 9, 2017
1 parent f7d0878 commit 5a4a4a7
Show file tree
Hide file tree
Showing 5 changed files with 232 additions and 235 deletions.
18 changes: 9 additions & 9 deletions api/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ func (a *App) getRouter() *mux.Router {
NewValidationMiddleware(func() interface{} { return &models.Offer{} }),
)).Methods("POST").Name("offers")

r.Handle("/offers/claim", Chain(
&OfferRequestHandler{App: a, Method: "claim"},
&NewRelicMiddleware{App: a},
&AuthMiddleware{App: a},
&LoggingMiddleware{App: a},
&VersionMiddleware{},
NewValidationMiddleware(func() interface{} { return &models.ClaimOfferPayload{} }),
)).Methods("PUT").Name("offer-requests")

r.Handle("/offers/{id}", Chain(
&OfferHandler{App: a, Method: "update"},
&NewRelicMiddleware{App: a},
Expand Down Expand Up @@ -144,15 +153,6 @@ func (a *App) getRouter() *mux.Router {
&VersionMiddleware{},
)).Methods("GET").Name("offer-requests")

r.Handle("/offers/claim", Chain(
&OfferRequestHandler{App: a, Method: "claim"},
&NewRelicMiddleware{App: a},
&AuthMiddleware{App: a},
&LoggingMiddleware{App: a},
&VersionMiddleware{},
NewValidationMiddleware(func() interface{} { return &models.ClaimOfferPayload{} }),
)).Methods("PUT").Name("offer-requests")

r.HandleFunc("/offers/{id}/impressions", Chain(
&OfferRequestHandler{App: a, Method: "impressions"},
&NewRelicMiddleware{App: a},
Expand Down
Loading

0 comments on commit 5a4a4a7

Please sign in to comment.