Deleting folders to put into recycle bin #1547
-
When deleting a folder using "folder.Delete()", is the folder and its files moved to recycle bin? From my testing it does not appear that it does. Is there a way, that I am missing, to make it do so? If not, is it possible to move a folder to the recycle bin using CreateCopyJobs? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@ajcaterino : recycling a folder is possible, but not implemented in PnP Core SDK. I'll create an issue from this discussion to track that ask. If you are in a rush you can use our custom API approach to implement this yourselves. See https://s-kainet.github.io/sp-rest-explorer/#/entity/SP.Folder for the SharePoint REST APIs for this. Creating a PR for this would even be better :-) |
Beta Was this translation helpful? Give feedback.
@ajcaterino : it does not matter from which object you call
ExecuteRequest
when making custom API calls when you're not using tokens in the API call. In your example you're not using the folder recycle method, but you're recycling a listitem. Please use either_api/Web/Lists(guid'{List.Id}')/Items({Parent.Id})/Folder
or_api/Web/Lists(guid'{Parent.Id}')/rootFolder
and replace the tokens before making the call