Add options to filter epoch for exercise progress graphs (1M, 3M, 6M, All), however if there isnt data in a selected epoch the endpoint returns 404. Havent bothered to look into to it, probs should clean up code as well

This commit is contained in:
Peter Stockings
2024-04-03 20:31:13 +11:00
parent dae4fcbf44
commit 6dafdf71dd
4 changed files with 37 additions and 7 deletions

4
app.py
View File

@@ -413,7 +413,9 @@ def get_exercise_progress_for_user(person_id, exercise_id):
'min_date'), '%Y-%m-%d')
max_date = convert_str_to_date(request.args.get(
'max_date'), '%Y-%m-%d')
exercise_progress = db.get_exercise_progress_for_user(person_id, exercise_id, min_date, max_date)
epoch = request.args.get('epoch', default='All')
exercise_progress = db.get_exercise_progress_for_user(person_id, exercise_id, min_date, max_date, epoch)
if not exercise_progress:
abort(404)