diff --git a/src/util/API.js b/src/util/API.js index 7654c823cb7abb9fac5126e16a81616efc3bcbe3..20b02ff45532e066564639ab7869eaffdac578da 100644 --- a/src/util/API.js +++ b/src/util/API.js @@ -520,7 +520,6 @@ export const API = { } }) .then((response) => { - console.log(response.data); return response.data; }) .catch(() => { diff --git a/src/views/WeekMenuView.vue b/src/views/WeekMenuView.vue index 44d1c054b512daca35ad4bd1187fd268986b2e65..34b7e8704efdb186cd647388ec9c7c94f27004ad 100644 --- a/src/views/WeekMenuView.vue +++ b/src/views/WeekMenuView.vue @@ -7,7 +7,6 @@ export default { data() { return { weekMenu: {}, - recipes: [], numberOfPeople: 1 } }, @@ -16,7 +15,10 @@ export default { this.numberOfPeople = event.target.value; }, generateWeekMenu() { - this.weekMenu = API.generateWeekMenu(this.numberOfPeople); + API.generateWeekMenu(this.numberOfPeople).then((menu) => { + this.weekMenu = menu; + this.recipes = menu.dayMenus; + }) }, loadWeekMenu() { API.getWeekMenu() @@ -26,8 +28,8 @@ export default { }) } }, - async mounted() { - await this.loadWeekMenu() + mounted() { + this.loadWeekMenu() } } </script> @@ -42,7 +44,7 @@ export default { </div> <div class="weekmenu-recipes"> - <RecipeCard v-for="recipe in this.recipes" :recipe=recipe></RecipeCard> + <RecipeCard v-for="recipe in this.weekMenu.dayMenus" :recipe=recipe></RecipeCard> </div> </div> </template>