🐛 Fix counting reactions in batch
This commit is contained in:
parent
db85cebe06
commit
d6b6f2e399
@ -49,8 +49,12 @@ func BatchListPostReactions(tx *gorm.DB, indexField string) (map[uint]map[string
|
|||||||
if _, ok := reactInfo[info.ID]; !ok {
|
if _, ok := reactInfo[info.ID]; !ok {
|
||||||
reactInfo[info.ID] = make(map[string]int64)
|
reactInfo[info.ID] = make(map[string]int64)
|
||||||
}
|
}
|
||||||
|
if _, exists := reactInfo[info.ID][info.Symbol]; exists {
|
||||||
|
reactInfo[info.ID][info.Symbol] += info.Count
|
||||||
|
} else {
|
||||||
reactInfo[info.ID][info.Symbol] = info.Count
|
reactInfo[info.ID][info.Symbol] = info.Count
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return reactInfo, nil
|
return reactInfo, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user