Exemplo n.º 1
0
        public async Task <ActionResult <GetEventModel> > AddEventParticipant(EventParticipantModel request)
        {
            var uid = new Guid(HttpContext.Request.Headers[AuthorizationHeaders.PersonUid].First());
            var validationResult = _eventValidation.ValidateAddParticipantModel(request);

            if (!validationResult.ValidationResult)
            {
                return(BadRequest(validationResult.ValidationMessage));
            }
            return(await _eventLogic.AddParticipant(request, uid));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> AcceptRandomPerson(EventParticipantModel request)
        {
            var uid = new Guid(HttpContext.Request.Headers[AuthorizationHeaders.PersonUid].First());
            var validationResult = _eventValidation.ValidateAddParticipantModel(request);

            if (!validationResult.ValidationResult)
            {
                return(BadRequest(validationResult.ValidationMessage));
            }
            await _eventLogic.AddParticipant(request, uid);

            await _eventLogic.AddEventSwipeHistory(request.PersonUid, request.EventUid);

            return(Ok(Messages.GetMessageJson(MessageTitles.RandomPersonAccepted, CultureParser.GetCultureFromHttpContext(HttpContext))));
        }