Use UserNotFound instead of NotFound

This commit is contained in:
Umar Bolatov
2021-05-16 17:48:25 -07:00
parent e943c55a91
commit 8731055786

View File

@@ -203,7 +203,7 @@ namespace BTCPayServer.Controllers.GreenField
var user = await _userManager.FindByIdAsync(userId);
if (user == null)
{
return NotFound();
return UserNotFound();
}
// We can safely delete the user if it's not an admin user
@@ -254,5 +254,10 @@ namespace BTCPayServer.Controllers.GreenField
return (await _userManager.GetUsersInRoleAsync(Roles.ServerAdmin)).Count == 1;
}
private IActionResult UserNotFound()
{
return this.CreateAPIError(404, "user-not-found", "The user was not found");
}
}
}