Beispiel #1
0
        public IActionResult Follow([FromQuery] string following)
        {
            var follow = new Follow()
            {
                Following = following
            };
            var identity = (ClaimsIdentity)User.Identity;
            var userId   = identity.FindFirst("user_id").Value;

            follow.Follower = userId;
            if (userId == following || _followService.AddFollows(follow) == null)
            {
                return(BadRequest());
            }

            return(Ok(follow));
        }