Exemplo n.º 1
0
        public async Task <ActionResult <GetEventModel> > RemoveEventParticipant(Guid personUid, Guid eventUid)
        {
            var uid = new Guid(HttpContext.Request.Headers[AuthorizationHeaders.PersonUid].First());
            var validationResult = _eventValidation.ValidateRemoveEventParticipant(personUid, eventUid, uid);

            if (!validationResult.ValidationResult)
            {
                return(BadRequest(validationResult.ValidationMessage));
            }
            await _eventLogic.RemoveParticipant(personUid, eventUid);

            return(await _eventLogic.GetEvent(eventUid));
        }