Added number of serves to recipe

This commit is contained in:
jableader 2024-05-19 21:22:58 +10:00
parent 4a1101be82
commit 794c32c2df
2 changed files with 3 additions and 1 deletions

View file

@ -13,6 +13,8 @@
<div v-if="!parse_failed && recipe"> <div v-if="!parse_failed && recipe">
<div class="image-container" v-if="image_styling" :style="image_styling" ></div> <div class="image-container" v-if="image_styling" :style="image_styling" ></div>
<h1><input class="recipe-name" type="text" v-model="recipe.name" /></h1> <h1><input class="recipe-name" type="text" v-model="recipe.name" /></h1>
<label for="recipe-serves">Number of serves: </label>
<input type="number" v-model="recipe.serves" />
<h3 class="recipe-link"><a :href="recipe.link">View Recipe</a></h3> <h3 class="recipe-link"><a :href="recipe.link">View Recipe</a></h3>
<h2>Ingredients</h2> <h2>Ingredients</h2>
<editable-ingredients-panel <editable-ingredients-panel

View file

@ -35,7 +35,7 @@ export default {
return await response.json(); return await response.json();
}, },
async parseRecipe(url) { async parseRecipe(url) {
const response = await fetch(BASE_URL + `/recipes/parse?url=${encodeURIComponent(url)}`); const response = await fetch(BASE_URL + `/recipes/parse?url=${encodeURIComponent(url)}`, { credentials: "include" });
return await response.json(); return await response.json();
}, },
async getRecipe(id) { async getRecipe(id) {