Skip to content

Commit

Permalink
Merge pull request #133 from WhyAsh5114/fix-multi-exercise-stat-bug
Browse files Browse the repository at this point in the history
fix: incorrect mesocycle stats
  • Loading branch information
WhyAsh5114 authored Oct 23, 2024
2 parents 829c3ef + d09560f commit 35ceb27
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/utils/mesocycleUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export function getAveragePercentageChangeOfExercisePerformances(
}

export function generatePerformanceChangesPerMuscleGroup(workoutsOfMesocycle: WorkoutsOfMesocycle) {
const allExercises = workoutsOfMesocycle.flatMap((wm) => wm.workout.workoutExercises);
const allExercises = workoutsOfMesocycle.flatMap((wm) =>
wm.workout.workoutExercises.map((exercise) => ({ ...exercise, name: exercise.name + wm.splitDayIndex.toString() }))
);
const groupedExercisesByMuscleGroup = groupExercisesByMuscleGroup(allExercises);

const fullyGroupedExercises = groupedExercisesByMuscleGroup.map(({ muscleGroup, exercises }) => ({
Expand Down

0 comments on commit 35ceb27

Please sign in to comment.