Shopping list fixes (#376)

* Refactor recipe to snake case

* Initialize raw ingredients

Fixes #356
This commit is contained in:
sephrat 2021-04-30 18:44:24 +02:00 committed by GitHub
parent 5e89903b2f
commit 72bc97eb24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,7 @@
<v-list-item-group color="primary"> <v-list-item-group color="primary">
<v-list-item <v-list-item
v-for="(item, i) in recipe.recipeIngredient" v-for="(item, i) in recipe.recipe_ingredient"
:key="i" :key="i"
> >
<v-list-item-content> <v-list-item-content>
@ -75,8 +75,9 @@ export default {
this.getRawIngredients(); this.getRawIngredients();
}, },
getRawIngredients() { getRawIngredients() {
this.rawIngredients = [];
this.ingredients.forEach(element => { this.ingredients.forEach(element => {
this.rawIngredients.push(element.recipeIngredient); this.rawIngredients.push(element.recipe_ingredient);
}); });
this.rawIngredients = this.rawIngredients.flat(); this.rawIngredients = this.rawIngredients.flat();