Skip to content
Snippets Groups Projects
Commit b070a7f0 authored by Isaac Evavold's avatar Isaac Evavold
Browse files

fix duplicate api calls on plan load

parent 6ca0121e
No related branches found
No related tags found
No related merge requests found
...@@ -411,13 +411,17 @@ const loadPlanYears = ( ...@@ -411,13 +411,17 @@ const loadPlanYears = (
...courseTermCodes, ...courseTermCodes,
...activeTermCodes, ...activeTermCodes,
]; ];
const uniqueYearCodes = unique(allTermCodes.map(toYearCode)); const uniqueYearCodes = unique(allTermCodes.map(toYearCode)).sort();
return uniqueYearCodes.sort(); return {
uniqueYearCodes,
notes,
courses,
};
}), }),
); );
const visibleYears$ = forkJoin(uniqueYearCodes$, notesAndCourses$).pipe( const visibleYears$ = uniqueYearCodes$.pipe(
map(([uniqueYearCodes, { notes, courses }]) => { map(({ uniqueYearCodes, notes, courses }) => {
const mapping: YearMapping = {}; const mapping: YearMapping = {};
uniqueYearCodes.forEach(yearCode => { uniqueYearCodes.forEach(yearCode => {
mapping[yearCode] = { mapping[yearCode] = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment