Fix issue where workout modal doesnt have tags/exercises lists populated when creating new workout

This commit is contained in:
Peter Stockings
2023-08-21 20:45:28 +10:00
parent 0cb737e1b8
commit 7730a3964b

5
app.py
View File

@@ -182,8 +182,11 @@ def get_workout_modal(person_id, workout_id):
def create_workout(person_id):
new_workout_id = db.create_workout(person_id)
workout = db.get_workout(person_id, new_workout_id)
(person_tags, workout_tags, selected_workout_tag_ids) = db.get_workout_tags(
person_id, new_workout_id)
exercises = db.get_all_exercises()
return render_template('partials/workout_modal.html',
workout=workout), 200, {"HX-Trigger": "updatedPeople"}
workout=workout, person_tags=person_tags, workout_tags=workout_tags, selected_workout_tag_ids=selected_workout_tag_ids, exercises=exercises), 200, {"HX-Trigger": "updatedPeople"}
@ app.route("/person/<int:person_id>/workout/<int:workout_id>/delete", methods=['DELETE'])