Ensure workouts are printed in order of start date descending

This commit is contained in:
Peter Stockings
2022-12-07 20:56:12 +11:00
parent 14ecae99e4
commit dac5e99f05
2 changed files with 5 additions and 0 deletions

View File

@@ -17,6 +17,9 @@ def get_workouts(topsets):
'StartDate': topsets_in_workout[0]['StartDate'],
'TopSets': [{"TopSetId": t['TopSetId'], "ExerciseId": t['ExerciseId'], "ExerciseName": t['ExerciseName'], "Weight": t['Weight'], "Repetitions": t['Repetitions']} for t in topsets_in_workout if t['TopSetId'] is not None]
})
workouts.sort(key=lambda x: x['StartDate'], reverse=True)
return workouts