From 4bbe1ed389ab3ee138388609e0438569b946616b Mon Sep 17 00:00:00 2001 From: Sindre Kjelsrud Date: Sun, 14 Jan 2024 11:55:47 +0100 Subject: [PATCH] :bug: fix duplicate questions appearing Co-authored-by: haraldnilsen Signed-off-by: Sindre Kjelsrud --- backend/cmd/db/get_user_questions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/cmd/db/get_user_questions.go b/backend/cmd/db/get_user_questions.go index c0e69ff..6d88162 100644 --- a/backend/cmd/db/get_user_questions.go +++ b/backend/cmd/db/get_user_questions.go @@ -44,7 +44,7 @@ func GetUserQuestions(respondentID int) ([]UserQuestions, error) { log.Fatalf("Error connecting to the database: %v\n", err) } - getQuestionsStatement := `SELECT s.SpørsmålID, s.tekst + getQuestionsStatement := `SELECT DISTINCT s.SpørsmålID, s.tekst FROM Spørsmål s LEFT JOIN Spørsmålsvar ss ON s.spørsmålID = ss.spørsmålID LEFT JOIN SvarVurdering sv ON ss.svarID = sv.svarID AND sv.respondentID = $1