public IActionResult Delete([FromForm(Name = ("ImageId"))] int id) { var files = _sharedFilesService.GetById(id).Data; var result = _sharedFilesService.Delete(files); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public async Task <ActionResult> RemoveFile(string name) { string userName = User.Identity.Name; int storageId = await storageService.GetStorageIdByUserName(userName); await fileService.AddFileToTrash(storageId, name); var shared = await sharedService.GetByName(name, userName); if (shared != null) { await sharedService.Delete(userName, shared.SharedLink); } return(RedirectToAction("Index")); }
public async Task <ActionResult> CancelSharing(string link) { await sharedService.Delete(User.Identity.Name, link); return(RedirectToAction("ManageSharedFiles")); }