mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
⚡ Added subfolders
This commit is contained in:
@@ -196,11 +196,16 @@ export class MicrosoftOneDrive implements INodeType {
|
||||
//https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_post_children?view=odsp-graph-online
|
||||
if (operation === 'create') {
|
||||
const name = this.getNodeParameter('name', i) as string;
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const body: IDataObject = {
|
||||
name,
|
||||
folder: {},
|
||||
};
|
||||
responseData = await microsoftApiRequest.call(this, 'POST', '/drive/root/children', body);
|
||||
let endpoint = '/drive/root/children';
|
||||
if (options.parentFolderId) {
|
||||
endpoint = `/drive/items/${options.parentFolderId}/children`;
|
||||
}
|
||||
responseData = await microsoftApiRequest.call(this, 'POST', endpoint, body);
|
||||
returnData.push(responseData);
|
||||
}
|
||||
//https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_list_children?view=odsp-graph-online
|
||||
|
||||
Reference in New Issue
Block a user