public async Task <IActionResult> GetRecruitTeams(long vkProfileId, long id)
        {
            logger.LogInformation($"GET Request {HttpContext.Request.Headers[":path"]}");

            var user = await context.Users
                       .Include(x => x.UserTeams)
                       .ThenInclude(y => y.Team)
                       .FirstOrDefaultAsync(u => u.Id == id);

            if (user == null)
            {
                throw new HttpStatusException(HttpStatusCode.NotFound, UserErrorMessages.NotFound, UserErrorMessages.DebugNotFound(id));
            }

            if (user.IsSearchable)
            {
                var profile = await context.Users
                              .Include(x => x.UserTeams)
                              .ThenInclude(y => y.Team)
                              .FirstOrDefaultAsync(x => x.Id == vkProfileId);

                var profileTeams = profile.UserTeams
                                   .Where(x => x.IsOwner)
                                   .Select(x => x.Team)
                                   .ToList();

                //команды оунера в которых не состоит юзер
                user.TeamsToRecruit = profileTeams.Except(user.GetActiveUserTeams().Select(x => x.Team).ToList()).ToList();
            }
            else
            {
                throw new HttpStatusException(HttpStatusCode.BadRequest, UserErrorMessages.IsNotSearchable);
            }

            return(Json(user.TeamsToRecruit));
        }
        public async Task <IActionResult> SetTeam(long id, long teamId, bool isTeamOffer = true)
        {
            logger.LogInformation($"POST Request {HttpContext.Request.Headers[":path"]}");

            var dbTeam = await context.Teams
                         .Include(x => x.Image)
                         .Include(x => x.UserTeams)
                         .ThenInclude(x => x.User)
                         .Include(x => x.UserTeams)
                         .ThenInclude(x => x.Team)
                         .ThenInclude(x => x.Event)
                         .FirstOrDefaultAsync(x => x.Id == teamId);

            if (dbTeam == null)
            {
                throw new HttpStatusException(HttpStatusCode.NotFound, TeamErrorMessages.NotFound, TeamErrorMessages.DebugNotFound(teamId));
            }

            var userActionToSet = isTeamOffer
                                ? UserActionEnum.ConsideringOffer
                                : UserActionEnum.SentRequest;

            if (dbTeam.UserTeams.All(x => x.UserId != id))
            {
                dbTeam.UserTeams.Add(new UserTeam {
                    UserId = id, UserAction = userActionToSet
                });
            }
            else
            {
                var user = dbTeam.UserTeams.FirstOrDefault(x => x.UserId == id);
                if (user == null)
                {
                    throw new HttpStatusException(HttpStatusCode.NotFound, UserErrorMessages.NotFound, UserErrorMessages.DebugNotFound(id));
                }

                user.UserAction = userActionToSet;
            }

            try
            {
                context.Update(dbTeam);
                await context.SaveChangesAsync();
            }
            catch (Exception)
            {
                throw new HttpStatusException(HttpStatusCode.InternalServerError, CommonErrorMessages.SaveChanges);
            }

            await SetTeamNotify(id, dbTeam, userActionToSet);

            return(Json(dbTeam));
        }