mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
✨ Adding Box API folder:get functionality (#1512)
This commit is contained in:
parent
63323178f1
commit
5a214fb4aa
|
@ -310,6 +310,12 @@ export class Box implements INodeType {
|
||||||
responseData = { success: true };
|
responseData = { success: true };
|
||||||
returnData.push(responseData as IDataObject);
|
returnData.push(responseData as IDataObject);
|
||||||
}
|
}
|
||||||
|
// https://developer.box.com/reference/get-folders-id/
|
||||||
|
if (operation === 'get') {
|
||||||
|
const folderId = this.getNodeParameter('folderId', i) as string;
|
||||||
|
responseData = await boxApiRequest.call(this, 'GET', `/folders/${folderId}`, qs);
|
||||||
|
returnData.push(responseData as IDataObject);
|
||||||
|
}
|
||||||
// https://developer.box.com/reference/get-search/
|
// https://developer.box.com/reference/get-search/
|
||||||
if (operation === 'search') {
|
if (operation === 'search') {
|
||||||
const query = this.getNodeParameter('query', i) as string;
|
const query = this.getNodeParameter('query', i) as string;
|
||||||
|
|
|
@ -20,6 +20,11 @@ export const folderOperations = [
|
||||||
value: 'create',
|
value: 'create',
|
||||||
description: 'Create a folder',
|
description: 'Create a folder',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'Get',
|
||||||
|
value: 'get',
|
||||||
|
description: 'Get a folder',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'Delete',
|
name: 'Delete',
|
||||||
value: 'delete',
|
value: 'delete',
|
||||||
|
@ -122,6 +127,26 @@ export const folderFields = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
|
/* folder:get */
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
|
{
|
||||||
|
displayName: 'Folder ID',
|
||||||
|
name: 'folderId',
|
||||||
|
type: 'string',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
operation: [
|
||||||
|
'get',
|
||||||
|
],
|
||||||
|
resource: [
|
||||||
|
'folder',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default: '',
|
||||||
|
description: 'Folder ID',
|
||||||
|
},
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* folder:delete */
|
/* folder:delete */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
Loading…
Reference in a new issue