Add missing response survey ID check

This commit is contained in:
TEC 2022-02-15 23:01:22 +08:00
parent afbb862ec7
commit c9fc27431e
Signed by: tec
GPG Key ID: 779591AFDB81F06C
1 changed files with 2 additions and 2 deletions

View File

@ -58,10 +58,10 @@ function responseids(survey::SurveyID, type::Symbol; cache::Bool=true)
if type == :all
responseids(surveyid; cache)
elseif type == :complete
SearchLight.query("SELECT id FROM responses WHERE completed IS NOT NULL") |>
SearchLight.query("SELECT id FROM responses WHERE survey=$survey AND completed IS NOT NULL") |>
r -> ResponseID.(r.id)
elseif type == :incomplete
SearchLight.query("SELECT id FROM responses WHERE completed IS NULL") |>
SearchLight.query("SELECT id FROM responses WHERE survey=$survey AND completed IS NULL") |>
r -> ResponseID.(r.id)
end
end