Skip to content

Commit

Permalink
Merge pull request #1921 from Giveth/remove-endaoment-recentlyUpdated
Browse files Browse the repository at this point in the history
add filter condition to remove endaoment projects from recently updated query sort
  • Loading branch information
divine-comedian authored Jan 29, 2025
2 parents 5b19b8b + ce160da commit 80df1f3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/repositories/projectRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { ProjectStatusHistory } from '../entities/projectStatusHistory';
import { Reaction } from '../entities/reaction';
import { SocialProfile } from '../entities/socialProfile';
import { PreviousRoundRank } from '../entities/previousRoundRank';
import { ORGANIZATION_LABELS } from '../entities/organization';

export const findProjectById = (projectId: number): Promise<Project | null> => {
// return Project.findOne({ id: projectId });
Expand Down Expand Up @@ -196,7 +197,11 @@ export const filterProjectsQuery = (params: FilterProjectQueryInputParams) => {
query.orderBy('project.creationDate', OrderDirection.DESC);
break;
case SortingField.RecentlyUpdated:
query.orderBy('project.updatedAt', OrderDirection.DESC);
query
.orderBy('project.updatedAt', OrderDirection.DESC)
.andWhere('organization.label != :label', {
label: ORGANIZATION_LABELS.ENDAOMENT,
});
break;
case SortingField.Oldest:
query.orderBy('project.creationDate', OrderDirection.ASC);
Expand Down

0 comments on commit 80df1f3

Please sign in to comment.