From e249709c792bb7e819be661a134e3a965d2a0919 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Tue, 10 Dec 2019 15:04:51 -0500 Subject: Fix blank tags/photos not added to Recipe --- recipeBuddy/src/app/add-recipe/add-recipe.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'recipeBuddy/src/app') diff --git a/recipeBuddy/src/app/add-recipe/add-recipe.component.ts b/recipeBuddy/src/app/add-recipe/add-recipe.component.ts index e6555d4..5109c34 100644 --- a/recipeBuddy/src/app/add-recipe/add-recipe.component.ts +++ b/recipeBuddy/src/app/add-recipe/add-recipe.component.ts @@ -121,8 +121,8 @@ export class AddRecipeComponent { (isNaN(cookTimeTmp) ? 0 :cookTimeTmp), //cookTime 0, //timesCooked 0, //rating - formData.tags.split(','), //tags - formData.photos.split(',') //photos + formData.tags.split(',').filter(word=> !(word==="")), //tags + formData.photos.split(',').filter(word=> !(word==="")) //photos ); this.restService.createRecipe(recipe).subscribe(); this.router.navigate(['/']); -- cgit v1.1