1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

Properly order heartbeats.

This commit is contained in:
Ferdinand Mütsch 2019-05-20 19:46:41 +02:00
parent 005b17a73c
commit d75da7681b

View File

@ -33,6 +33,7 @@ func (srv *HeartbeatService) GetAllWithin(from, to time.Time, user *models.User)
Where(&models.Heartbeat{UserID: user.ID}). Where(&models.Heartbeat{UserID: user.ID}).
Where("time >= ?", from). Where("time >= ?", from).
Where("time <= ?", to). Where("time <= ?", to).
Order("time asc").
Find(&heartbeats).Error; err != nil { Find(&heartbeats).Error; err != nil {
return nil, err return nil, err
} }