Example #1
0
        public async Task <IActionResult> AddPlayers([FromBody] List <string> playerNames)
        {
            var userId = accountService.GetUserId();

            (IEnumerable <PlayerVM> addToLeaderboard, bool isOK) = await service.CreatePlayersAsync(playerNames, userId);

            if (isOK)
            {
                return(Ok(addToLeaderboard));
            }
            else
            {
                return(BadRequest(addToLeaderboard));
            }
        }