public ActionResult DeleteIngredient(int ingredientId, int mealId) { _ingredientServices.DeleteIngredient(ingredientId); var viewModel = GetMealModel(mealId); return(PartialView("IngredientsTable", viewModel)); }
public async Task <IActionResult> DeleteIngredient(Guid id) { try { await ingredientServices.DeleteIngredient(id); this.toast.AddSuccessToastMessage(Exceptions.SuccessfullyDeleted); return(RedirectToAction("ListIngredients", "Ingredient")); } catch (Exception) { this.toast.AddErrorToastMessage(Exceptions.SomethingWentWrong); return(RedirectToAction("ListIngredients")); } }