Skip to content

Commit

Permalink
Merge pull request #7401 from jrjohnson/common-deprecations
Browse files Browse the repository at this point in the history
Load school cohorts
  • Loading branch information
jrjohnson authored Sep 11, 2023
2 parents 58c04c9 + e634bfa commit a0e1365
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 a0e1365

Please sign in to comment.