Created
July 13, 2016 19:46
-
-
Save joshgrib/b952913849159388dfea0a0eed832d0b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getCommentById(id){ | |
return recipeData.getAllRecipes().then( (all_recipes) => { | |
resp_comment = {}; | |
all_recipes.forEach( (recipe) => { | |
recipe.comments.forEach( (comment) => { | |
if(comment._id === id){ | |
resp_comment = {'_id':id, 'recipeId':recipe._id, 'recipeTitle':recipe.title, 'comment':comment.comment, 'poster':comment.poster}; | |
} | |
}); | |
}); | |
return resp_comment; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment