From 24af1ddf9b994c79a297eb4c081749023e093a2c Mon Sep 17 00:00:00 2001 From: Jacob Casper Date: Thu, 16 Apr 2020 22:16:16 -0500 Subject: [PATCH] Fix not requesting enough data for Scan --- backend/routes/artist/artist.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/routes/artist/artist.go b/backend/routes/artist/artist.go index d26f66d..5a584e3 100644 --- a/backend/routes/artist/artist.go +++ b/backend/routes/artist/artist.go @@ -166,7 +166,7 @@ func ByGenre(env *env.Env) routes.Handler { genreName := r.FormValue("genre_name") if genreName != "" { rows, err := env.Db.Db.Query(` -SELECT a.ID, a.NAME +SELECT a.ID, a.NAME, a.POPULARITY FROM ARTIST a JOIN ARTIST_GENRE_XREF x ON a.ID = x.ARTIST_ID JOIN GENRE g ON g.ID = x.GENRE_ID @@ -185,6 +185,7 @@ WHERE g.NAME = lower(?) for rows.Next() { artist := types.Artist{} if err := rows.Scan(&artist.ID, &artist.Name, &artist.Popularity); err != nil { + log.Print(err) http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) return } -- 2.20.1