diff --git a/src/Yavsc.Server/ViewModels/Account/UnregisterViewModel.cs b/src/Yavsc.Server/ViewModels/Account/UnregisterViewModel.cs index 2d1ee488..b672e8bb 100644 --- a/src/Yavsc.Server/ViewModels/Account/UnregisterViewModel.cs +++ b/src/Yavsc.Server/ViewModels/Account/UnregisterViewModel.cs @@ -1,8 +1,12 @@ +using System.ComponentModel.DataAnnotations; + namespace Yavsc.ViewModels.Account { public class UnregisterViewModel { + [Required] public string UserId { get; set; } + public string ReturnUrl { get; set; } } diff --git a/src/Yavsc/Controllers/Accounting/AccountController.cs b/src/Yavsc/Controllers/Accounting/AccountController.cs index db67b74f..6baa120e 100644 --- a/src/Yavsc/Controllers/Accounting/AccountController.cs +++ b/src/Yavsc/Controllers/Accounting/AccountController.cs @@ -687,7 +687,7 @@ namespace Yavsc.Controllers [HttpGet, Authorize] public IActionResult Delete() { - return View(); + return View(new UnregisterViewModel { UserId = User.GetUserId() }); } [HttpGet, Authorize("AdministratorOnly")] diff --git a/src/Yavsc/Views/Account/Delete.cshtml b/src/Yavsc/Views/Account/Delete.cshtml index 7e4401d5..cfb50206 100644 --- a/src/Yavsc/Views/Account/Delete.cshtml +++ b/src/Yavsc/Views/Account/Delete.cshtml @@ -8,6 +8,7 @@
@Html.Hidden("ReturnUrl") + @Html.Hidden("UserId")