After successfully adding workout and confirming prompt user is redirected back to overview page
This commit is contained in:
2
app.py
2
app.py
@@ -204,7 +204,7 @@ def get_workouts_for_user(user_id):
|
|||||||
workouts_data.append({
|
workouts_data.append({
|
||||||
'id': workout.id,
|
'id': workout.id,
|
||||||
'user_id': user_id,
|
'user_id': user_id,
|
||||||
'start_time': format_date_with_ordinal(start_time, '%H:%M %B %dth %Y'),
|
'start_time': format_date_with_ordinal(start_time, '%#H:%M %B %dth %Y'),
|
||||||
'duration': format_duration(duration),
|
'duration': format_duration(duration),
|
||||||
'average_rpm': int(average_rpm)
|
'average_rpm': int(average_rpm)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -118,7 +118,7 @@
|
|||||||
},
|
},
|
||||||
body: JSON.stringify({ workout: workout }),
|
body: JSON.stringify({ workout: workout }),
|
||||||
}).then(res => res.json())
|
}).then(res => res.json())
|
||||||
.then(res => swal("Submitted", JSON.stringify(res), "success"))
|
.then(res => swal("Submitted", JSON.stringify(res), "success").then(isConfirm => window.location.href = '/'))
|
||||||
.catch(err => swal("Failed to submit workout", err.message, "error"));
|
.catch(err => swal("Failed to submit workout", err.message, "error"));
|
||||||
|
|
||||||
workout = [];
|
workout = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user