summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-12-10 15:04:51 -0500
committerTucker Evans <tuckerevans24@gmail.com>2019-12-10 15:04:51 -0500
commite249709c792bb7e819be661a134e3a965d2a0919 (patch)
treeb4bf0db0f7b397a96a0832880dd81ff2cf1b4164
parente8d327e3783831107400456de84ecd79241b5773 (diff)
Fix blank tags/photos not added to Recipe
-rw-r--r--recipeBuddy/src/app/add-recipe/add-recipe.component.ts4
1 files changed, 2 insertions, 2 deletions
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(['/']);