add submit button with mat angular

This commit is contained in:
bastien ollier
2024-06-24 11:03:37 +02:00
committed by clfreville2
parent 3a48fd8426
commit 45d11a8a0e

View File

@@ -82,12 +82,8 @@ export class RecipeAddComponent {
} }
const id = parseInt(value.selectedIngredient!); const id = parseInt(value.selectedIngredient!);
if (this.ingredientEntries.find((ingredient) => ingredient.idIngredient === id)) { if (this.ingredientEntries.find((ingredient) => ingredient.idIngredient === id)) {
console.log("oh");
return; return;
} }
console.log("ah");
console.log(this.ingredients.find(v => v.id === id)?.name)
console.log(this.ingredients);
this.ingredientEntries.push({ this.ingredientEntries.push({
idIngredient: id, idIngredient: id,
idRecipe: -1, idRecipe: -1,