This commit is contained in:
parent
f6916ae5bb
commit
af0b834bf3
4
db/db.go
4
db/db.go
@ -239,12 +239,12 @@ func GetStat(chatID int64) (map[string]int, error) {
|
||||
}
|
||||
for caloriesCursor.Next(context.Background()) {
|
||||
var result Calories
|
||||
if err := cursor.Decode(&result); err != nil {
|
||||
if err := caloriesCursor.Decode(&result); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
res["Калории"] += result.Count
|
||||
}
|
||||
if err := cursor.Err(); err != nil {
|
||||
if err := caloriesCursor.Err(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user