public IActionResult Modify(RecipeModifyModel modifyRecipe) { if (ModelState.IsValid) { var recipe = ModelConverter.ConvertFromRecipeModify(modifyRecipe); RecipesService.UpdateRecipe(recipe); return(RedirectToAction("ModifyOverview")); } return(View(modifyRecipe)); }
public ActionResult <Recipe> Update([FromBody] Recipe model) { var result = RecipeService.UpdateRecipe(model); if (result != null) { result.RecipeAuthor.PasswordHash = null; result.RecipeAuthor.PasswordSalt = null; return(Ok(result)); } else { return(BadRequest()); } }