Esempio n. 1
0
        public async Task <IActionResult> AddLike(InfoViewLikes like)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            int userId = (await userRepository.GetUserByLogin(User.Identity.Name)).Id;
            int likeId = await likesRepository.AddNewLike(mapper.Map <Likes>(like), userId);

            return(Ok(likeId));
        }