Пример #1
0
        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));
        }
Пример #2
0
        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"));
        }
Пример #3
0
        public async Task <ActionResult> CancelSharing(string link)
        {
            await sharedService.Delete(User.Identity.Name, link);

            return(RedirectToAction("ManageSharedFiles"));
        }