summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschencej <55326070+schencej@users.noreply.github.com>2019-12-12 11:58:28 -0500
committerGitHub <noreply@github.com>2019-12-12 11:58:28 -0500
commit677bc7c69d893faff175bb76c0948d8ef9fbeaf4 (patch)
tree0bb38c7fdf5615a2c6b71063cf3041103aaea0bb
parent09aea62746e50d8284dc234692e7641cca03cc42 (diff)
parent9af4ca5c5d8be8bacc512f9d84a58deef6fff835 (diff)
Merge pull request #26 from tuckerevans/edit_pass_recipe
Fix use passService for recipe to edit
-rw-r--r--recipeBuddy/src/app/edit-recipe/edit-recipe.component.ts16
1 files 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(