public ActionResult AddOrUpdateRecipe([FromBody] RecipeViewModel recipe) { var users = _userService.GetAll(); var content = ""; content = content + recipe.Name + " " + "Rating " + recipe.Rating; _userService.NotifyAllUsers(users.Select(x => x.Email).ToList(), "Added a new Recipe!", content); _recipesService.AddOrUpdateRecipe(recipe); return(Ok(new { status = "Ok" })); }
public async Task <IActionResult> AddRecipe(Recipe recipe) { return(Ok(await _recipeService.AddOrUpdateRecipe(recipe))); }
public ActionResult AddOrUpdateRecipe([FromBody] RecipeViewModel recipe) { _recipesService.AddOrUpdateRecipe(recipe); return(Ok(new { status = "Ok" })); }