Add ability to choose graphs to render, speed by default

This commit is contained in:
Peter Stockings
2023-03-16 23:09:37 +11:00
parent 3c5661e7b2
commit 699390c28a
4 changed files with 55 additions and 5 deletions

7
app.py
View File

@@ -157,6 +157,13 @@ def workout(user_id, workout_id, graph_type):
return jsonify({'message': 'Workout {} not found for user {}.'.format(workout_id, user_id)}), 404
@app.route('/user/<int:user_id>/workout/<int:workout_id>/view', methods=['GET'])
def view_workout(user_id, workout_id):
workout = Workout.query.filter_by(user_id=user_id, id=workout_id).first()
graph_types = request.args.getlist('graph_types')
return render_template('workout_view.html', workout=workout, graph_types=graph_types)
@app.route('/user/<int:user_id>/workout/<int:workout_id>/delete', methods=['DELETE'])
def delete_workout(user_io, workout_id):
# Delete the workout and its associated cadence readings