Fix error thrown when successfully submitting workout due to json->JSON and improve look of graphs

This commit is contained in:
Peter Stockings
2023-03-08 21:17:49 +11:00
parent ec2e848f48
commit 6b8c22d13c
2 changed files with 15 additions and 6 deletions

View File

@@ -48,6 +48,7 @@
<svg id="graph" class="bg-white shadow-md"></svg>
</div>
</div>
<img src="http://127.0.0.1:5000/user/1/workout/2" alt="No image">
</div>
</div>
<script>
@@ -115,7 +116,7 @@
},
body: JSON.stringify({ workout: workout }),
}).then(res => res.json())
.then(res => swal("Submitted", json.stringify(res), "success"))
.then(res => swal("Submitted", JSON.stringify(res), "success"))
.catch(err => swal("Failed to submit workout", err.message, "error"));
workout = [];
@@ -163,7 +164,7 @@
const line = d3.line()
.x((d) => xScale(d.x))
.y((d) => yScale(d.y))
.curve(d3.curveCardinal);
.curve(d3.curveCardinal.tension(0.25));
// Create an empty data array
let data = [];