protected async Task OnDeleteItem(TreeViewNode <SubscriptionItemViewModelBase> item) { deleteRecursive = false; deleteDownloadedFiles = false; deleteItemName = item.Data.Name; if (item.Data is SubscriptionFolderViewModel folderVm) { deleteFolder = true; await deleteDialog.ShowDialog(async result => { if (result == DialogResult.Primary) { await SubscriptionManager.Delete(folderVm.Folder, deleteRecursive, deleteDownloadedFiles); } }); } else if (item.Data is SubscriptionViewModel subVm) { deleteFolder = false; await deleteDialog.ShowDialog(async result => { if (result == DialogResult.Primary) { await SubscriptionManager.Delete(subVm.Subscription, deleteDownloadedFiles); } }); } }
public async Task <IActionResult> Delete([FromBody] SubscriptionDeleteRequest request) { var user = await userManager.GetUserAsync(User); await subscriptionManager.Delete(user, request.Ids, request.DeleteDownloadedFiles); return(Ok(responseFactory.Success())); }