Fix error thrown when successfully submitting workout due to json->JSON and improve look of graphs
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user