Skip to content

Commit

Permalink
chore: fix get all referrals
Browse files Browse the repository at this point in the history
  • Loading branch information
kehiy committed Dec 7, 2023
1 parent 960718b commit e0699ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions discord/referral.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,17 @@ func (rs *ReferralStore) AddPoint(code string) bool {
}

func marshaReferralJSON(m *sync.Map) ([]byte, error) {
tmpMap := make(map[string]*Validator)
tmpMap := make(map[string]*Referral)

m.Range(func(k, v interface{}) bool {
tmpMap[k.(string)] = v.(*Validator)
tmpMap[k.(string)] = v.(*Referral)
return true
})
return json.MarshalIndent(tmpMap, " ", " ")
}

func unmarshalReferralJSON(data []byte) (*sync.Map, error) {
var tmpMap map[string]*Validator
var tmpMap map[string]*Referral
m := &sync.Map{}

if err := json.Unmarshal(data, &tmpMap); err != nil {
Expand Down

0 comments on commit e0699ad

Please sign in to comment.