Skip to content

Commit

Permalink
Update TaskCompletionHandler.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hrazasalman committed Aug 29, 2024
1 parent db8ab85 commit 017ed2a
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export class TaskCompletionHandler extends ChangeHandler {
dataTime: surveyResponse.data_time,
})),
);

return this.models.task.find({
[QUERY_CONJUNCTIONS.AND]: {
status: 'to_do',
Expand All @@ -54,7 +53,7 @@ export class TaskCompletionHandler extends ChangeHandler {
},
[QUERY_CONJUNCTIONS.RAW]: {
sql: `${surveyIdAndEntityIdPairs
.map(() => `(survey_id = ? AND entity_id = ? AND created_at <= ?)`)
.map(() => `(task.survey_id = ? AND task.entity_id = ? AND created_at <= ?)`)
.join(' OR ')}`,
parameters: surveyIdAndEntityIdPairs.flatMap(({ surveyId, entityId, dataTime }) => [
surveyId,
Expand Down

0 comments on commit 017ed2a

Please sign in to comment.