Пример #1
0
        public async Task <JsonResult> LikeDislike(int postedItemId, bool?liked)
        {
            if (postedItemId == 0)
            {
                return(Json(new { }));
            }

            var userId = HttpContext.User.Identity.GetUserId();

            if (String.IsNullOrEmpty(userId))
            {
                return(Json(new { }));
            }

            await _socialService.PersistLikeDislike(postedItemId, userId, liked);

            return(Json(new { success = true }));
        }