mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
Unify get and post routes for create user
This commit is contained in:
parent
ea8f121cb0
commit
0235624c64
@ -307,14 +307,14 @@ namespace BTCPayServer.Controllers
|
||||
|
||||
[Route("server/users/new")]
|
||||
[HttpGet]
|
||||
public IActionResult NewUser()
|
||||
public IActionResult CreateUser()
|
||||
{
|
||||
ViewData["AllowIsAdmin"] = _Options.AllowAdminRegistration;
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
[Route("server/users")]
|
||||
[Route("server/users/new")]
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> CreateUser(RegisterViewModel model)
|
||||
{
|
||||
@ -337,7 +337,7 @@ namespace BTCPayServer.Controllers
|
||||
}
|
||||
|
||||
// If we got this far, something failed, redisplay form
|
||||
return View("NewUser", model);
|
||||
return View(model);
|
||||
}
|
||||
|
||||
[Route("server/users/{userId}/delete")]
|
||||
|
@ -30,9 +30,9 @@
|
||||
|
||||
@if (ViewData["AllowIsAdmin"] is true)
|
||||
{
|
||||
<div class="form-group">
|
||||
<label asp-for="IsAdmin"></label>
|
||||
<input asp-for="IsAdmin" type="checkbox" class="form-check-inline"/>
|
||||
<div class="form-group form-check">
|
||||
<input asp-for="IsAdmin" type="checkbox" class="form-check-input"/>
|
||||
<label asp-for="IsAdmin" class="form-check-label"></label>
|
||||
<span asp-validation-for="IsAdmin" class="text-danger"></span>
|
||||
</div>
|
||||
}
|
@ -9,7 +9,7 @@
|
||||
<div class="col-lg-9 col-xl-8">
|
||||
<span>Total Users: @Model.Total</span>
|
||||
<span class="pull-right">
|
||||
<a asp-action="NewUser" class="btn btn-primary" role="button">
|
||||
<a asp-action="CreateUser" class="btn btn-primary" role="button">
|
||||
<span class="fa fa-plus"></span> Add User
|
||||
</a>
|
||||
</span>
|
||||
|
Loading…
Reference in New Issue
Block a user