Ejemplo n.º 1
0
        public ActionResult CloseSession([FromBody] SessionModel model)
        {
            int userRole = GetAuthorizedUserRole();

            if (userRole != 1)
            {
                return(Unauthorized());
            }

            var currentSessionId = _sessionService.GetCurrentSession();

            _sessionService.CloseSession(currentSessionId);

            _sessionService.AddWinnersByThisSession(currentSessionId);

            return(Ok("Current session closed!"));
        }