Skip to content

Commit

Permalink
🐛 chore: emailFromRequest transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
perebaj committed Sep 29, 2023
1 parent 3de62cc commit 0da6008
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/transactionhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,19 @@ func (s transactionHandler) upload(w http.ResponseWriter, r *http.Request) {
}

func (s transactionHandler) transactions(w http.ResponseWriter, r *http.Request) {
_, claims, _ := jwtauth.FromContext(r.Context())
if claims["email"] == nil {
email, err := emailFromRequest(r)
if err != nil {
sendErr(w, http.StatusBadRequest, Error{"email_required", "email is required"})
return
}
email := claims["email"].(string)
tResponse, err := s.storage.Transactions(r.Context(), email)

t, err := s.storage.Transactions(r.Context(), email)
if err != nil {
sendErr(w, http.StatusInternalServerError, err)
return
}

send(w, http.StatusOK, tResponse)
send(w, http.StatusOK, t)
}

// Transaction represents the raw transaction from the file.
Expand Down

0 comments on commit 0da6008

Please sign in to comment.