Пример #1
0
        public ActionResult AcceptJoinRequest(int requestID)
        {
            var request = partyJoinRequestRepository.GetById(requestID);
            var citizen = SessionHelper.LoggedCitizen;

            MethodResult result;

            if ((result = partyService.CanAcceptJoinRequest(request, citizen)).IsError)
            {
                return(JsonError(result));
            }

            //after accepting request entities will be deleted so we will need to access them right now.
            var citizenName = request.Citizen.Entity.Name;

            partyService.AcceptJoinRequest(request);

            return(JsonSuccess($"Request accepted. {citizenName} is now your party member."));
        }