Exemple #1
0
 public IActionResult AddLike([FromBody] int id)
 {
     try
     {
         var recipe = _recipeRepository.GetRecipeById(id);
         recipe.likes += 1;
         var state = _recipeRepository.AddLikeOrDislike(recipe);
         if (state == true)
         {
             Ok(state);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return(StatusCode(StatusCodes.Status500InternalServerError));
 }