Skip to content

Commit

Permalink
Fix draft answers not appearing in CSV export (GREY-343)
Browse files Browse the repository at this point in the history
  • Loading branch information
hrickards committed Jul 25, 2016
1 parent cb73824 commit 058ea38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/app/controllers/products.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ module.exports = {

'LEFT JOIN ( ' +
'SELECT ' +
'max("SurveyAnswers"."version") as max,' +
'COALESCE(max("SurveyAnswers"."version"), -1) as max,' +
'"SurveyAnswers"."questionId",' +
'"SurveyAnswers"."userId",' +
'"SurveyAnswers"."UOAid",' +
Expand All @@ -622,7 +622,7 @@ module.exports = {
'AND ("SurveyAnswers"."userId" = "sa"."userId")) ' +
'AND ("SurveyAnswers"."UOAid" = "sa"."UOAid")) ' +
'AND ("SurveyAnswers"."wfStepId" = "sa"."wfStepId") ' +
'AND ("SurveyAnswers"."version" = "sa"."max") ' +
'AND (COALESCE("SurveyAnswers"."version", -1) = "sa".max) ' +
') ' +
'WHERE ( ' +
pgEscape('("Tasks"."productId" = %s) ', id) +
Expand Down

0 comments on commit 058ea38

Please sign in to comment.