Skip to content

Commit

Permalink
feat: add filter by active projects by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Reshzera committed Aug 22, 2024
1 parent a0c6242 commit 3eae98b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/repositories/projectRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ export const totalProjectsPerDate = async (
): Promise<number> => {
const query = Project.createQueryBuilder('project');

query.andWhere(`project.statusId = ${ProjStatus.active}`);

if (fromDate) {
query.andWhere(`project."creationDate" >= '${fromDate}'`);
}
Expand All @@ -437,10 +439,9 @@ export const totalProjectsPerDate = async (
}

if (onlyListed) {
query.andWhere(
`project.statusId = ${ProjStatus.active} AND project.reviewStatus = :reviewStatus`,
{ reviewStatus: ReviewStatus.Listed },
);
query.andWhere(`project.reviewStatus = :reviewStatus`, {
reviewStatus: ReviewStatus.Listed,
});
}

if (networkId) {
Expand Down

0 comments on commit 3eae98b

Please sign in to comment.