Skip to content

Commit

Permalink
fix: fixes survey createdBy filtering for null createdBy surveys (#2577)
Browse files Browse the repository at this point in the history
  • Loading branch information
gupta-piyush19 committed May 6, 2024
1 parent 328579f commit 386436a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/lib/survey/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,18 @@ export const buildWhereClause = (filterCriteria?: TSurveyFilterCriteria) => {
whereClause.push({ createdBy: filterCriteria.createdBy.userId });
}
if (filterCriteria.createdBy.value[0] === "others") {
whereClause.push({ createdBy: { not: filterCriteria.createdBy.userId } });
whereClause.push({
OR: [
{
createdBy: {
not: filterCriteria.createdBy.userId,
},
},
{
createdBy: null,
},
],
});
}
}
}
Expand Down

0 comments on commit 386436a

Please sign in to comment.