forked from svitvojimilioni/kuhkal
init
This commit is contained in:
24
kuhkal/templates/pages/calculate.html
Normal file
24
kuhkal/templates/pages/calculate.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% extends "layouts/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div x-data="{ results: {},
|
||||
recipe_id: 1,
|
||||
ammount:40,
|
||||
async getResults() {
|
||||
this.results = await (await fetch('http://localhost:5000/calculate', {
|
||||
method:'POST',
|
||||
body: JSON.stringify({
|
||||
recipe_id: this.recipe_id,
|
||||
ammount: this.ammount
|
||||
}),
|
||||
headers: {
|
||||
'Content-type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
})).json();
|
||||
console.log(this.results);
|
||||
}
|
||||
} ">
|
||||
{% include "includes/calculate_form.html" %}
|
||||
{% include "includes/calculate_results.html" %}
|
||||
</div>
|
||||
{% endblock content %}
|
Reference in New Issue
Block a user