mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 20:54:07 -08:00
⚡ Minor improvement to Pipedrive-Node
This commit is contained in:
parent
305894d9b4
commit
e3e3f038d6
|
@ -49,7 +49,7 @@ export async function pipedriveApiRequest(this: IHookFunctions | IExecuteFunctio
|
|||
|
||||
const options: OptionsWithUri = {
|
||||
headers: {
|
||||
"Accept": "application/json",
|
||||
Accept: 'application/json',
|
||||
},
|
||||
method,
|
||||
qs: query,
|
||||
|
|
|
@ -2160,6 +2160,13 @@ export class Pipedrive implements INodeType {
|
|||
default: '',
|
||||
description: 'Will filter Deals by the provided Organization ID.',
|
||||
},
|
||||
{
|
||||
displayName: 'RAW Data',
|
||||
name: 'rawData',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: `Returns the data exactly in the way it got received from the API.`,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
@ -2708,6 +2715,15 @@ export class Pipedrive implements INodeType {
|
|||
|
||||
if (operation === 'search' && responseData.data && responseData.data.items) {
|
||||
responseData.data = responseData.data.items;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
if (additionalFields.rawData !== true) {
|
||||
responseData.data = responseData.data.map((item: { result_score: number, item: object }) => {
|
||||
return {
|
||||
result_score: item.result_score,
|
||||
...item.item,
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (Array.isArray(responseData.data)) {
|
||||
|
|
Loading…
Reference in a new issue