Skip to content

Commit

Permalink
Fix not updating referral code
Browse files Browse the repository at this point in the history
  • Loading branch information
violog committed Jul 17, 2024
1 parent 7916ce6 commit ba2115e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/service/handlers/activate_balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func ActivateBalance(w http.ResponseWriter, r *http.Request) {
return
}

referral, err := ReferralsQ(r).FilterInactive().Get(req.Data.Attributes.ReferredBy)
referral, err := ReferralsQ(r).FilterInactive().Get(referralCode)
if err != nil {
Log(r).WithError(err).Error("Failed to get referral by ID")
ape.RenderErr(w, problems.InternalError())
Expand All @@ -73,7 +73,7 @@ func ActivateBalance(w http.ResponseWriter, r *http.Request) {
}

err = BalancesQ(r).FilterByNullifier(balance.Nullifier).Update(map[string]any{
data.ColReferredBy: balance.ReferredBy,
data.ColReferredBy: referralCode,
data.ColLevel: level,
})
if err != nil {
Expand Down

0 comments on commit ba2115e

Please sign in to comment.