mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
✨ Add delete:Folder to Microsoft Drive node (#1636)
This commit is contained in:
parent
fbc11080c7
commit
415928db3c
|
@ -20,6 +20,11 @@ export const folderOperations = [
|
||||||
value: 'create',
|
value: 'create',
|
||||||
description: 'Create a folder',
|
description: 'Create a folder',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'Delete',
|
||||||
|
value: 'delete',
|
||||||
|
description: 'Delete a folder',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'Get Children',
|
name: 'Get Children',
|
||||||
value: 'getChildren',
|
value: 'getChildren',
|
||||||
|
@ -91,7 +96,7 @@ export const folderFields = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* folder:getChildren */
|
/* folder:getChildren/delete */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
displayName: 'Folder ID',
|
displayName: 'Folder ID',
|
||||||
|
@ -100,6 +105,7 @@ export const folderFields = [
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
operation: [
|
operation: [
|
||||||
|
'delete',
|
||||||
'getChildren',
|
'getChildren',
|
||||||
],
|
],
|
||||||
resource: [
|
resource: [
|
||||||
|
|
|
@ -222,6 +222,13 @@ export class MicrosoftOneDrive implements INodeType {
|
||||||
responseData = await microsoftApiRequest.call(this, 'POST', endpoint, body);
|
responseData = await microsoftApiRequest.call(this, 'POST', endpoint, body);
|
||||||
returnData.push(responseData);
|
returnData.push(responseData);
|
||||||
}
|
}
|
||||||
|
//https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_delete?view=odsp-graph-online
|
||||||
|
if (operation === 'delete') {
|
||||||
|
const folderId = this.getNodeParameter('folderId', i) as string;
|
||||||
|
responseData = await microsoftApiRequest.call(this, 'DELETE', `/drive/items/${folderId}`);
|
||||||
|
responseData = { success: true };
|
||||||
|
returnData.push(responseData as IDataObject);
|
||||||
|
}
|
||||||
//https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_list_children?view=odsp-graph-online
|
//https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_list_children?view=odsp-graph-online
|
||||||
if (operation === 'getChildren') {
|
if (operation === 'getChildren') {
|
||||||
const folderId = this.getNodeParameter('folderId', i) as string;
|
const folderId = this.getNodeParameter('folderId', i) as string;
|
||||||
|
|
Loading…
Reference in a new issue