Skip to content

Commit

Permalink
fix(participationType filter): added participationType filter for mem…
Browse files Browse the repository at this point in the history
…ber/filter api
  • Loading branch information
navneethkrish committed Dec 20, 2024
1 parent 104b152 commit ddf054a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/web-api/src/members/members.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export class MemberController {
builtQuery.where,
this.membersService.buildNameFilters(queryParams),
this.membersService.buildRoleFilters(queryParams),
this.membersService.buildRecentMembersFilter(queryParams)
this.membersService.buildRecentMembersFilter(queryParams),
this.membersService.buildParticipationTypeFilter(queryParams)
],
};
return await this.membersService.findAll(builtQuery);
Expand Down Expand Up @@ -114,10 +115,14 @@ export class MemberController {
const queryParams = request.query;
const builder = new PrismaQueryBuilder(queryableFields);
const builtQuery = builder.build(queryParams);
const { name__icontains } = queryParams;
const { name__icontains, isHost, isSpeaker } = queryParams;
if (name__icontains) {
delete builtQuery.where?.name;
}
if (isHost || isSpeaker) {
delete builtQuery.where?.isHost;
delete builtQuery.where?.isSpeaker;
}
builtQuery.where = {
AND: [
builtQuery.where,
Expand Down

0 comments on commit ddf054a

Please sign in to comment.