Remove unreachable code (#2961)

This commit is contained in:
Nicolas Dorier
2021-10-15 16:34:40 +09:00
committed by GitHub
parent 843a2491ef
commit 9df4429fc2
2 changed files with 2 additions and 11 deletions

View File

@@ -241,15 +241,6 @@ namespace BTCPayServer.Controllers
return RedirectToAction(nameof(SetPassword)); return RedirectToAction(nameof(SetPassword));
} }
[HttpGet()]
public IActionResult DeleteUser()
{
return View("Confirm", new ConfirmModel("Delete account", "Your account will be permanently deleted. This action will also delete all stores, invoices, apps and data associated with your account.", "Delete")
{
ActionUrl = "DeleteUserPost"
});
}
[HttpPost()] [HttpPost()]
public async Task<IActionResult> DeleteUserPost() public async Task<IActionResult> DeleteUserPost()
@@ -257,7 +248,7 @@ namespace BTCPayServer.Controllers
var user = await _userManager.GetUserAsync(User); var user = await _userManager.GetUserAsync(User);
if (user == null) if (user == null)
{ {
throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'."); return NotFound();
} }
await _userService.DeleteUserAndAssociatedData(user); await _userService.DeleteUserAndAssociatedData(user);

View File

@@ -41,7 +41,7 @@
See more actions See more actions
</button> </button>
<div id="danger-zone" class="collapse"> <div id="danger-zone" class="collapse">
<a id="delete-user" class="btn btn-outline-danger mb-5" asp-action="DeleteUser" data-confirm-input="DELETE" data-bs-toggle="modal" data-bs-target="#ConfirmModal" data-action="DeleteUserPost" data-description="This action will also delete all stores, invoices, apps and data associated with the user.">Delete your user.</a> <a id="delete-user" class="btn btn-outline-danger mb-5" data-confirm-input="DELETE" data-bs-toggle="modal" data-bs-target="#ConfirmModal" data-action="DeleteUserPost" data-description="This action will also delete all stores, invoices, apps and data associated with the user.">Delete your user.</a>
</div> </div>
</form> </form>