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? |
Answered by
jansenbe
Oct 14, 2024
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 :-) |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ajcaterino : it does not matter from which object you call
ExecuteRequestwhen 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})/Folderor_api/Web/Lists(guid'{Parent.Id}')/rootFolderand replace the tokens before making the call