Example #1
0
        public async Task <IActionResult> DeleteUser(AppUser model)
        {
            IdentityResult result = await _userService.DeleteUserAsync(model.Id);

            if (result.Succeeded)
            {
                TempData["SuccessMessage"] = "Корстувача видалено";
                FileServices remove = new FileServices();
                remove.Delete("wwwroot/qrr/file-" + model.Id + ".qrr");
                remove.Delete("wwwroot/avatars/avatar-" + model.Id + ".jpg");
            }
            else
            {
                TempData["ErrorMessage"] = result.Errors.FirstOrDefault().Description;
            }
            return(RedirectToAction(nameof(Index)));
        }
        public async Task <ActionResult> DeleteFile(int id)
        {
            await _filesManager.Delete(id, User.Identity.GetUserId());

            return(Json("STATUS_OK"));
        }