satellite/satellitedb: fix nil value from offers table (#2587)
* fix nil value * Oops
This commit is contained in:
parent
2e3ad0ce2a
commit
3e9f90b7ee
@ -70,9 +70,15 @@ func (db *offersDB) GetCurrentByType(ctx context.Context, offerType rewards.Offe
|
||||
}
|
||||
o.AwardCredit = currency.Cents(awardCreditInCents)
|
||||
o.InviteeCredit = currency.Cents(inviteeCreditInCents)
|
||||
o.RedeemableCap = int(redeemableCap.Int64)
|
||||
o.AwardCreditDurationDays = int(awardCreditDurationDays.Int64)
|
||||
o.InviteeCreditDurationDays = int(inviteeCreditDurationDays.Int64)
|
||||
if redeemableCap.Valid {
|
||||
o.RedeemableCap = int(redeemableCap.Int64)
|
||||
}
|
||||
if awardCreditDurationDays.Valid {
|
||||
o.AwardCreditDurationDays = int(awardCreditDurationDays.Int64)
|
||||
}
|
||||
if inviteeCreditDurationDays.Valid {
|
||||
o.InviteeCreditDurationDays = int(inviteeCreditDurationDays.Int64)
|
||||
}
|
||||
|
||||
return &o, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user