From 9af4ca5c5d8be8bacc512f9d84a58deef6fff835 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Wed, 11 Dec 2019 17:56:49 -0500 Subject: Fix use passService for recipe to edit --- recipeBuddy/src/app/edit-recipe/edit-recipe.component.ts | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/recipeBuddy/src/app/edit-recipe/edit-recipe.component.ts b/recipeBuddy/src/app/edit-recipe/edit-recipe.component.ts index 203f733..e7966b3 100644 --- a/recipeBuddy/src/app/edit-recipe/edit-recipe.component.ts +++ b/recipeBuddy/src/app/edit-recipe/edit-recipe.component.ts @@ -13,6 +13,7 @@ import { Recipe } from '../DataModels/recipe'; import { Ingredient } from '../DataModels/ingredient' import { Step } from '../DataModels/step'; import { BackendService } from '../REST_service/backend.service'; +import { RecipePassService } from '../recipePass/recipe-pass.service'; @Component({ selector: 'app-edit-recipe', @@ -21,18 +22,7 @@ import { BackendService } from '../REST_service/backend.service'; }) export class EditRecipeComponent implements OnInit { - baseRecipe: Recipe = new Recipe (15, //id - '', //name - '', //description - [], //ingredients - [], //steps - 0, //servingSize - 0, //cookTime - 0, //timesCooked - 0, //rating - [], //tags - [] //photos - ); + baseRecipe: Recipe = this.passService.getRecipe(); recipeForm = this.fb.group({ recipeName: ['', Validators.required], @@ -59,7 +49,7 @@ export class EditRecipeComponent implements OnInit { constructor(private fb: FormBuilder, private restService: BackendService, private router: Router, - /*private passService: PassService,*/ + private passService: RecipePassService, ) { restService.getRecipe(this.baseRecipe.id).subscribe( -- cgit v1.1