public async Task <IActionResult> SwitchTeam(int teamId)
        {
            userSessionHelper.SetTeamId(teamId);
            await userAccountManager.SetDefaultTeam(userSessionHelper.UserId, teamId);

            return(Json("Changed"));
        }
        public async Task <IActionResult> SwitchTeam(int teamId)
        {
            _userSessionHelper.SetTeamId(teamId);
            await _userAccountManager.SetDefaultTeam(_userSessionHelper.UserId, teamId);

            tc.TrackEvent("Switching Team");
            return(Json("Changed"));
        }
예제 #3
0
        public async Task <JsonResult> SwitchTeam(int id)
        {
            if (!teamManager.DoesCurrentUserBelongsToTeam(this.userSessionHelper.UserId, id))
            {
                return(Json(new { Status = "Error", Message = "You do not belong to this team!" }));
            }

            userSessionHelper.SetTeamId(id);
            await userAccountManager.SetDefaultTeam(userSessionHelper.UserId, id);

            return(Json(new { Status = "Success" }));
        }
예제 #4
0
        public async Task <JsonResult> SwitchTeam(int id)
        {
            try
            {
                if (!_teamManager.DoesCurrentUserBelongsToTeam(this._userSessionHelper.UserId, id))
                {
                    tc.TrackEvent("Trying to access some one else's team");
                    return(Json(new { Status = "Error", Message = "You do not belong to this team!" }));
                }


                _userSessionHelper.SetTeamId(id);
                await _userAccountManager.SetDefaultTeam(_userSessionHelper.UserId, id);

                return(Json(new { Status = "Success" }));
            }
            catch (Exception ex)
            {
                tc.TrackException(ex);
                return(Json(new { Status = "Error", Message = "Error processing your request" }));
            }
        }