🐛 fix duplicate questions appearing

Co-authored-by: haraldnilsen <harald_998@hotmail.com>
Signed-off-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
Sindre Kjelsrud 2024-01-14 11:55:47 +01:00
parent c0aa51902c
commit 4bbe1ed389
Signed by untrusted user who does not match committer: sidski
GPG key ID: D2BBDF3EDE6BA9A6

View file

@ -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