From 280cd1268eaf27d8c0358724cbb744f33b304c3d Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sun, 25 Jun 2017 17:16:13 +0200 Subject: [PATCH] Updated dashboard with new aerogo/aerospike version --- pages/dashboard/dashboard.go | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pages/dashboard/dashboard.go b/pages/dashboard/dashboard.go index 67c49eb3..bb17ac97 100644 --- a/pages/dashboard/dashboard.go +++ b/pages/dashboard/dashboard.go @@ -34,19 +34,17 @@ func Get(ctx *aero.Context) string { followIDList := user.Following var followingList []*arn.User - if len(followIDList) > 0 { - if len(followIDList) > maxFollowing { - followIDList = followIDList[:maxFollowing] - } - - userList, err := arn.DB.GetMany("User", followIDList) - - if err != nil { - return ctx.Error(500, "Error fetching followed users", err) - } - - followingList = userList.([]*arn.User) + if len(followIDList) > maxFollowing { + followIDList = followIDList[:maxFollowing] } + userList, err := arn.DB.GetMany("User", followIDList) + + if err != nil { + return ctx.Error(500, "Error fetching followed users", err) + } + + followingList = userList.([]*arn.User) + return ctx.HTML(components.Dashboard(posts, followingList)) }