From 7143c1feebbd528fce189bc79b3982561d342b2e Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 21 Jul 2019 02:54:16 +0200 Subject: [PATCH] fixes user's auto-deletion :-) --- src/Yavsc.Server/ViewModels/Account/UnregisterViewModel.cs | 4 ++++ src/Yavsc/Controllers/Accounting/AccountController.cs | 2 +- src/Yavsc/Views/Account/Delete.cshtml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) 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")