Skip to content

Commit e7e720c

Browse files
authored
Merge pull request #453 from openscript-ch/445-error-searching-by-studystudy-id
error searching by studystudy
2 parents d825982 + 4df12c2 commit e7e720c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/sixty-chairs-search.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@quassel/backend": patch
3+
---
4+
5+
Fix searching questionnaire by study title

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)