diff --git a/web/vue/src/App.vue b/web/vue/src/App.vue index 45d9159..1a8d03b 100644 --- a/web/vue/src/App.vue +++ b/web/vue/src/App.vue @@ -2,14 +2,14 @@
-

Loading...

+
Loading...
Error: {{ status.error_msg }}
-

Livre de recettes

+ v-on:close="closeActiveView" + v-on:add="addToPlanning" /> @@ -18,7 +18,7 @@

Planning

- +
@@ -60,6 +60,11 @@ export default { closeActiveView: function() { this.active_view = -1; }, + addToPlanning: function(idx) { + let mealKey = ["Lundi", "Lunch"]; + let mealData = this.items[idx]; + this.$refs.weekPlanning.setMeal(mealKey, mealData); + }, deleteRecipe: function(id) { fetch("http://localhost:8000/api/delete/" + id) .then((res) => res.json()) @@ -87,10 +92,14 @@ export default { this.statue.error_msg = err; console.error(err); }); + }, + initWeekPlanning: function() { + this.$refs.weekPlanning.fetchSolution(); } }, mounted () { this.fetchRecipesList(); + this.initWeekPlanning(); } } diff --git a/web/vue/src/components/Heading.vue b/web/vue/src/components/Heading.vue index c24b77c..b399376 100644 --- a/web/vue/src/components/Heading.vue +++ b/web/vue/src/components/Heading.vue @@ -1,5 +1,5 @@