Skip to content

Commit

Permalink
Bug #233498 - FIx status filter in cohort list for cohort admin role
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnuvinay89 committed Jan 24, 2025
1 parent f4dbaa8 commit b237fa2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/adapters/postgres/cohort-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -803,11 +803,17 @@ export class PostgresCohortService {
count = totalCount;

let cohortIds = data.map(cohortId => cohortId.cohortId);
let whereClauseCondition: any = {
cohortId: In(cohortIds),
tenantId: filters.tenantId,
};

if (filters.status && filters.status.length > 0) {
whereClauseCondition.status = In(filters.status);
}

let cohortAllData = await this.cohortRepository.find({
where: {
cohortId: In(cohortIds),
tenantId : filters.tenantId
},
where: whereClauseCondition,
});

for (let data of cohortAllData) {
Expand Down

0 comments on commit b237fa2

Please sign in to comment.