Пример #1
0
        public void InvitePlayer(string email, string teamId)
        {
            var subject     = $"You have been invited to team {teamId} on NT League";
            var tokenUrl    = _inviteService.GenerateTokenUrl(teamId);
            var bodyMessage = $"To accept the invite from {teamId} enter the link : {tokenUrl}";

            _inviteService.Invite(email, bodyMessage, subject);
        }
Пример #2
0
 public StatusCodeResult Index(string email)
 {
     try
     {
         _inviteService.Invite(email);
         return(Ok());
     }
     catch (McUserNotFoundException)
     {
         return(BadRequest());
     }
 }
Пример #3
0
        public async Task <IActionResult> Add([FromBody] InviteRequest inviteRequest)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            Result result = await _inviteService.Invite(inviteRequest);

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

            return(Ok(new EmptyResult()));
        }