Skip to content

Commit

Permalink
Merge pull request #254 from Giveth/feature/add_accept_giv_filter
Browse files Browse the repository at this point in the history
Feature: Add acceptGiv filter to projects
  • Loading branch information
mohammadranjbarz authored Dec 16, 2021
2 parents 9cd1305 + 206f10b commit 30e6fc0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions entities/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ class Project extends BaseEntity {
}

static addFilterQuery(query: any, filter: string, filterValue: boolean) {
if (filter === 'givingBlocksId') {
const acceptGiv = filterValue ? 'IS' : 'IS NOT';
return query.andWhere(`project.${filter} ${acceptGiv} NULL`);
}

return query.andWhere(`project.${filter} = ${filterValue}`);
}

Expand Down
1 change: 1 addition & 0 deletions resolvers/projectResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class ProjectAndAdmin {

enum FilterField {
Verified = 'verified',
AcceptGiv = 'givingBlocksId',
}

enum OrderDirection {
Expand Down

0 comments on commit 30e6fc0

Please sign in to comment.