diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 4ec491b..ea3ca56 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -8,10 +8,15 @@ let serverurl = 'http://192.168.0.105:3000'; let last_page = 1; let recipes_list = []; + let last_recipe; // First loading let recipes_p = axios.get(serverurl+"/recipes?page=" + last_page); recipes_p.then(function (response) { + axios.get(serverurl+"/recipe?r_id="+response.data.recipes[0].id).then(function (response) { + last_recipe = response.data.recipe; + console.log(last_recipe); + }) recipes_list = response.data.recipes; }) .catch(function (error) { @@ -41,13 +46,27 @@ {#await recipes_p} {:then} +
+ {#if last_recipe != undefined} + +
+
+

{last_recipe.title}

+

{last_recipe.desc}

+
+
+ {last_recipe.title} +
+
+ {/if} +
{#each recipes_list as recipe}
{recipe.title}
-

{recipe.ctime} / {recipe.cal}

+

{recipe.ctime} / {recipe.cal}

{recipe.title}

{/each} @@ -57,4 +76,17 @@ {/await}
- \ No newline at end of file + + + \ No newline at end of file diff --git a/src/routes/Header.svelte b/src/routes/Header.svelte index f353808..c0c2bdd 100644 --- a/src/routes/Header.svelte +++ b/src/routes/Header.svelte @@ -65,9 +65,12 @@ \ No newline at end of file