Skip to content

Commit

Permalink
Merge pull request #2340 from brave-intl/master
Browse files Browse the repository at this point in the history
Production Release 2024-02-06_01
  • Loading branch information
clD11 authored Feb 6, 2024
2 parents d4c77b2 + 62d5bd9 commit c658300
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions services/wallet/controllers_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ func LinkSolanaAddress(s *Service) handlers.AppHandler {
}

type challengeRequest struct {
PaymentID uuid.UUID `json:"paymentId" valid:"required"`
PaymentID uuid.UUID `json:"paymentId"`
}

type challengeResponse struct {
Expand All @@ -538,8 +538,10 @@ func CreateChallenge(s *Service) handlers.AppHandler {
return handlers.WrapError(err, "error decoding body", http.StatusBadRequest)
}

if _, err := govalidator.ValidateStruct(chlReq); err != nil {
return handlers.WrapValidationError(err)
if uuid.Equal(chlReq.PaymentID, uuid.Nil) {
return handlers.ValidationError("request", map[string]interface{}{
"paymentID": "cannot be nil or empty",
})
}

ctx := r.Context()
Expand Down

0 comments on commit c658300

Please sign in to comment.