Пример #1
0
        public async Task <IActionResult> AddApplyRequest([FromForm] int applierId, CancellationToken cancellationToken)
        {
            var result = await _contactApplyRequestRepository.ApprovalAsync(UserIdentity.UserId, applierId, cancellationToken);

            if (!result)
            {
                return(BadRequest());
            }
            UserIdentity applier = await _userService.GetBaseUserInfoAsync(applierId);

            var userInfo = await _userService.GetBaseUserInfoAsync(UserIdentity.UserId);

            await _contactRepository.AddContacAsync(UserIdentity.UserId, applier, cancellationToken);

            await _contactRepository.AddContacAsync(applierId, userInfo, cancellationToken);

            return(Ok());
        }