Very messy code that implements read status tracking. Needs major cleanup.
This commit is contained in:
parent
e0d70d16f9
commit
effdf07cef
24 changed files with 2179 additions and 24 deletions
|
|
@ -38,7 +38,8 @@ namespace API.Controllers
|
|||
[HttpPost("register")]
|
||||
public async Task<ActionResult<UserDto>> Register(RegisterDto registerDto)
|
||||
{
|
||||
if (await UserExists(registerDto.Username))
|
||||
|
||||
if (await _userManager.Users.AnyAsync(x => x.UserName == registerDto.Username))
|
||||
{
|
||||
return BadRequest("Username is taken.");
|
||||
}
|
||||
|
|
@ -88,9 +89,9 @@ namespace API.Controllers
|
|||
};
|
||||
}
|
||||
|
||||
private async Task<bool> UserExists(string username)
|
||||
{
|
||||
return await _userManager.Users.AnyAsync(user => user.UserName == username.ToLower());
|
||||
}
|
||||
// private async Task<bool> UserExists(string username)
|
||||
// {
|
||||
// return await _userManager.Users.AnyAsync(user => user.UserName == username.ToLower());
|
||||
// }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue