Skip to content

Commit

Permalink
fix(api): preserve middleware order for checkbook endpoint to ensure …
Browse files Browse the repository at this point in the history
…proper execution
  • Loading branch information
gacevicljubisa committed Oct 22, 2024
1 parent 656fc4e commit af97829
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,17 +504,21 @@ func (s *Service) mountBusinessDebug() {

handle("/chequebook/deposit", web.ChainHandlers(
s.checkChequebookAvailability,
s.gasConfigMiddleware("chequebook deposit"),
web.FinalHandler(jsonhttp.MethodHandler{
"POST": http.HandlerFunc(s.chequebookDepositHandler),
"POST": web.ChainHandlers(
s.gasConfigMiddleware("chequebook deposit"),
web.FinalHandlerFunc(s.chequebookDepositHandler),
),
}),
))

handle("/chequebook/withdraw", web.ChainHandlers(
s.checkChequebookAvailability,
s.gasConfigMiddleware("chequebook withdraw"),
web.FinalHandler(jsonhttp.MethodHandler{
"POST": http.HandlerFunc(s.chequebookWithdrawHandler),
"POST": web.ChainHandlers(
s.gasConfigMiddleware("chequebook withdraw"),
web.FinalHandlerFunc(s.chequebookWithdrawHandler),
),
}),
))

Expand Down

0 comments on commit af97829

Please sign in to comment.