public async Task <IActionResult> Invite([FromRoute] string groupId, [FromBody] InviteToGroupRequest inviteToGroupRequest)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            Core.Models.Result.Result result = await _inviteService.InviteToGroup(groupId, inviteToGroupRequest);

            return(result.ToNewResult().ToApiResult());
        }
        public async Task <IActionResult> Invite([FromRoute] string groupId, [FromBody] InviteToGroupRequest inviteToGroupRequest)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            Result result = await _inviteService.InviteToGroup(groupId, inviteToGroupRequest);

            if (result.Failure)
            {
                ModelState.AddErrors(result);
                return(BadRequest(ModelState));
            }

            return(Ok(new EmptyResult()));
        }
Пример #3
0
        public async Task <IActionResult> Add([FromRoute] string groupId, [FromBody] InviteToGroupRequest request)
        {
            Core.Models.Result.Result result = await _inviteService.InviteToGroup(groupId, request);

            return(result.ToNewResult().ToApiResult());
        }