Пример #1
0
        public async Task <IActionResult> Follow(string follower, string following)
        {
            try
            {
                if (!GetClaimByName(SUB).Equals(follower))
                {
                    return(BadRequest());
                }

                if (await _usersRepository.AddFollowerAsync(follower, following))
                {
                    return(Ok());
                }

                _logger.LogDebug("and there");
            }
            catch (Exception e)
            {
                _logger.LogError($"Error while adding a follower\n {e.Message}");
            }

            return(BadRequest());
        }