Exemple #1
0
        public async Task <IActionResult> AddNewLike([FromBody] LikeDto likeDto)
        {
            if (likeDto.SharedMealUUID == null)
            {
                return(BadRequest());
            }

            if (likeDto.Value == 0 || likeDto.Value > 1 || likeDto.Value < -1)
            {
                return(BadRequest());
            }

            return(Ok(await _likeService.AddNewLike(likeDto, HttpContext.User.Identity.Name)));
        }