Skip to content

Commit b237fa2

Browse files
committed
Bug #233498 - FIx status filter in cohort list for cohort admin role
1 parent f4dbaa8 commit b237fa2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/adapters/postgres/cohort-adapter.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -803,11 +803,17 @@ export class PostgresCohortService {
803803
count = totalCount;
804804

805805
let cohortIds = data.map(cohortId => cohortId.cohortId);
806+
let whereClauseCondition: any = {
807+
cohortId: In(cohortIds),
808+
tenantId: filters.tenantId,
809+
};
810+
811+
if (filters.status && filters.status.length > 0) {
812+
whereClauseCondition.status = In(filters.status);
813+
}
814+
806815
let cohortAllData = await this.cohortRepository.find({
807-
where: {
808-
cohortId: In(cohortIds),
809-
tenantId : filters.tenantId
810-
},
816+
where: whereClauseCondition,
811817
});
812818

813819
for (let data of cohortAllData) {

0 commit comments

Comments
 (0)