Skip to content

Commit 229b9fe

Browse files
committed
fix: questionnaire search on study title
1 parent 814d0b6 commit 229b9fe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/backend/src/research/questionnaires/questionnaires.service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ export class QuestionnairesService {
6868
}) {
6969
return (
7070
await this.questionnaireRepository.findAll({
71-
where: { ...(participantId && { participant: participantId }), ...(studyTitle && { study: { title: { $fulltext: studyTitle } } }) },
71+
where: {
72+
...(participantId && { participant: participantId }),
73+
...(studyTitle && { participant: { studies: { $some: { title: { $fulltext: studyTitle } } } } }),
74+
},
7275
populate: ["participant"],
7376
orderBy: sortBy && { [sortBy]: sortOrder },
7477
})

0 commit comments

Comments
 (0)