users are now renamed after joining the discord server

This commit is contained in:
Sarah Faey 2022-11-21 23:05:10 +01:00
parent 601bd10c39
commit 17d8983fb0
4 changed files with 74 additions and 0 deletions

View file

@ -184,5 +184,23 @@ namespace Lieb.Controllers
{
return _discordService.GetUserRenameServers();
}
[HttpGet]
[Route("[action]/{userId}")]
public ActionResult<ApiRaid.Role.User> GetUser(ulong userId)
{
LiebUser user = _userService.GetLiebUser(userId);
if(user != null)
{
return Ok(new ApiRaid.Role.User(){
UserId = user.Id,
UserName = user.Name,
AccountName = user.GuildWars2Accounts.FirstOrDefault(a => a.GuildWars2AccountId == user.MainGW2Account, new GuildWars2Account()).AccountName
});
}
return Problem("user not found");
}
}
}