diff options
Diffstat (limited to 'internal/handlers/elements.go')
-rw-r--r-- | internal/handlers/elements.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/internal/handlers/elements.go b/internal/handlers/elements.go index 7fcd9ce..65a1c2d 100644 --- a/internal/handlers/elements.go +++ b/internal/handlers/elements.go @@ -1,7 +1,6 @@ package handlers import ( - "apjournal/internal/models" "html/template" "net/http" ) @@ -28,17 +27,12 @@ func (h *Handlers) ShowRecommended(w http.ResponseWriter, r *http.Request) { var username string // TODO: getusername // TODO: get recommendations for user - plusA, err := h.repo.DBActionRecommend(username, models.ActionTypePlus) + acts, err := h.fetchRecommendations(username, 5) if err != nil { abortWithError(w, err.Error()) return } - minusA, err := h.repo.DBActionRecommend(username, models.ActionTypeMinus) - if err != nil { - abortWithError(w, err.Error()) - return - } - h.log.Debug("got actions", "plus#", len(plusA), "minus#", len(minusA)) + h.log.Debug("got actions", "acts#", len(acts)) tmpl, err := template.ParseGlob("components/*.html") if err != nil { abortWithError(w, err.Error()) |