Skip to content

Commit

Permalink
Fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaptoss committed Jun 12, 2024
1 parent c393c09 commit 948b071
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/service/handlers/verify_passport.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,12 @@ func fulfillPassportScanEvent(r *http.Request, balance data.Balance, country dat
event, err = EventsQ(r).
FilterByID(event.ID).
Update(data.EventFulfilled, nil, nil)
if err != nil {
return fmt.Errorf("failed to update event: %w", err)
}

if !evTypePassport.AutoClaim || !country.ReserveAllowed || country.Reserved >= country.ReserveLimit {
return err
return nil
}

_, err = claimEventWithPoints(r, *event, evTypePassport.Reward, &balance)
Expand Down

0 comments on commit 948b071

Please sign in to comment.