forked from svitvojimilioni/kuhkal
25 lines
659 B
HTML
25 lines
659 B
HTML
{% extends "layouts/base.html" %}
|
|
|
|
{% block content %}
|
|
<div x-data="{ results: {},
|
|
recipe_id: 1,
|
|
ammount:40,
|
|
async getResults() {
|
|
this.results = await (await fetch('http://solidarna.cyberdeck.xyz/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 %}
|