Skip to content

Commit

Permalink
Merge pull request #17 from vishnuvinay89/all-saas-0.2-dev
Browse files Browse the repository at this point in the history
Bug #233498 - FIx status filter in cohort list for cohort admin role
  • Loading branch information
sudeeppr1998 authored Jan 27, 2025
2 parents f4dbaa8 + b237fa2 commit 93f8c8d
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 93f8c8d

Please sign in to comment.