This commit is contained in:
Michael Zhang 2021-07-21 17:15:11 -05:00
parent d86eef1ca5
commit 1bfb3caf55
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B

View file

@ -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)