public async Task <IActionResult> Invite(Invitation invitation)
        {
            var url    = _configuration["LoginUrl"];
            var userId = HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
            await _invitationService.AddAsync(url, userId, invitation.Email);

            return(Ok());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Add([FromBody] AddInvitationRequest request, [FromRoute] int accountId)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState.GetErrorMessages()));
            }

            var response = await _invitationService.AddAsync(request, accountId);

            if (!response.IsValid)
            {
                return(BadRequest(response.Message));
            }
            return(Ok(response));
        }