From ba2115e79af861c850f6cf3f3850c30dce25e905 Mon Sep 17 00:00:00 2001 From: violog <51th.apprent1ce.f0rce@gmail.com> Date: Wed, 17 Jul 2024 16:41:37 +0300 Subject: [PATCH] Fix not updating referral code --- internal/service/handlers/activate_balance.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/handlers/activate_balance.go b/internal/service/handlers/activate_balance.go index edd623d..f1bb250 100644 --- a/internal/service/handlers/activate_balance.go +++ b/internal/service/handlers/activate_balance.go @@ -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()) @@ -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 {