From cfd5c723c06973c0a5c51d9de2d17d19b71f9cab Mon Sep 17 00:00:00 2001 From: "pakintada@gmail.com" Date: Mon, 22 Jan 2024 09:11:38 +0700 Subject: [PATCH] updatable topping --- .../recipes/recipe-details/recipe-details.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/app/features/recipes/recipe-details/recipe-details.component.ts b/client/src/app/features/recipes/recipe-details/recipe-details.component.ts index a03055c..097788d 100644 --- a/client/src/app/features/recipes/recipe-details/recipe-details.component.ts +++ b/client/src/app/features/recipes/recipe-details/recipe-details.component.ts @@ -278,11 +278,13 @@ export class RecipeDetailsComponent implements OnInit { // check length of toppinglist console.log("tpl length", this.tpl.length, "original length", (this.rawRecipe! as any).ToppingSet.length); - for(let ti = 0; ti < this.tpl.length; ti++){ // check at the same index if(!isEqual(this.tpl[ti][0], (this.rawRecipe as any).ToppingSet[ti])){ console.log('topping list changed', ti, this.tpl[ti][0], (this.rawRecipe as any).ToppingSet[ti]); + // update raw recipe + (this.rawRecipe as any).ToppingSet[ti] = this.tpl[ti][0]; + console.log('after update topping', (this.rawRecipe as any).ToppingSet[ti]); } }