all buildings working

This commit is contained in:
arnaucube
2019-06-16 00:02:22 +02:00
parent 625c006b8e
commit c32ae80b68
2 changed files with 21 additions and 13 deletions

View File

@@ -91,7 +91,9 @@ func (srv Service) GetUserById(userid bson.ObjectId) (*models.User, error) {
if err != nil {
return nil, err
}
return models.UserDbToUser(srv.db, userDb), nil
user := models.UserDbToUser(srv.db, userDb)
_, err = user.GetResources()
return user, err
}
func (srv Service) GetUserPlanetsById(userid bson.ObjectId) ([]*models.Planet, error) {
@@ -102,15 +104,3 @@ func (srv Service) GetUserPlanetsById(userid bson.ObjectId) ([]*models.Planet, e
}
return planets, err
}
// func (srv Service) GetUser(id bson.ObjectId) (*models.User, error) {
// // update user stats
// user := getUserFromDB
// user.GetStats()
//
// }
//
// func (srv Service) GetUser(id bson.ObjectId) (*models.User, error) {
// // update user stats
//
// }