z
This commit is contained in:
parent
d86eef1ca5
commit
1bfb3caf55
1 changed files with 4 additions and 1 deletions
5
db/db.go
5
db/db.go
|
@ -84,7 +84,10 @@ func (db *Db) UpdateMapperLastEvent(userId int, eventId int) (err error) {
|
|||
err = errors.Wrap(err, "couldn't get user events from API")
|
||||
return
|
||||
}
|
||||
eventId = events[0].ID
|
||||
|
||||
if len(events) > 0 {
|
||||
eventId = events[0].ID
|
||||
}
|
||||
}
|
||||
|
||||
db.gorm.Model(&User{}).Where("id = ?", userId).Update("latest_event_id", eventId)
|
||||
|
|
Loading…
Reference in a new issue