Skip to content

Commit

Permalink
Load school cohorts
Browse files Browse the repository at this point in the history
Without calling the deprecated school.cohorts property
  • Loading branch information
jrjohnson committed Sep 11, 2023
1 parent f8c61d4 commit e634bfa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/components/user-profile-cohorts-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ export default class UserProfileCohortsManagerComponent extends Component {
}

async getSelectableCohortsBySchool(school) {
const cohorts = await school.cohorts;
const sortedCohorts = await sortCohorts(cohorts.slice());
const programs = await school.programs;
const programYears = (await Promise.all(programs.map((p) => p.programYears))).flat();
const cohorts = await Promise.all(programYears.map((py) => py.cohort));
const sortedCohorts = await sortCohorts(cohorts);
return sortedCohorts.filter((cohort) => {
return this.args.primaryCohort !== cohort && !this.args.secondaryCohorts.includes(cohort);
});
Expand Down

0 comments on commit e634bfa

Please sign in to comment.