mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 05:17:28 -08:00
⚡ Small improvements on Drift-Node
This commit is contained in:
parent
657732ac68
commit
5a608cbf5b
|
@ -65,7 +65,7 @@ export const contactFields = [
|
|||
],
|
||||
},
|
||||
},
|
||||
description: 'The email of the Contact',
|
||||
description: 'The email of the contact.',
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
|
@ -89,14 +89,14 @@ export const contactFields = [
|
|||
name: 'name',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The name of the Contact',
|
||||
description: 'The name of the contact.',
|
||||
},
|
||||
{
|
||||
displayName: 'Phone',
|
||||
name: 'phone',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The phone number associated with the Contact',
|
||||
description: 'The phone number associated with the contact.',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -143,21 +143,21 @@ export const contactFields = [
|
|||
name: 'email',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The email of the Contact',
|
||||
description: 'The email of the contact.',
|
||||
},
|
||||
{
|
||||
displayName: 'Name',
|
||||
name: 'name',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The name of the Contact',
|
||||
description: 'The name of the contact.',
|
||||
},
|
||||
{
|
||||
displayName: 'Phone',
|
||||
name: 'phone',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The phone number associated with the Contact',
|
||||
description: 'The phone number associated with the contact.',
|
||||
},
|
||||
]
|
||||
},
|
||||
|
|
|
@ -82,7 +82,7 @@ export class Drift implements INodeType {
|
|||
body.phone = additionalFields.phone as string;
|
||||
}
|
||||
responseData = await driftApiRequest.call(this, 'POST', '/contacts', { attributes: body });
|
||||
responseData = responseData.data
|
||||
responseData = responseData.data;
|
||||
}
|
||||
//https://devdocs.drift.com/docs/updating-a-contact
|
||||
if (operation === 'update') {
|
||||
|
@ -99,13 +99,13 @@ export class Drift implements INodeType {
|
|||
body.email = updateFields.email as string;
|
||||
}
|
||||
responseData = await driftApiRequest.call(this, 'PATCH', `/contacts/${contactId}`, { attributes: body });
|
||||
responseData = responseData.data
|
||||
responseData = responseData.data;
|
||||
}
|
||||
//https://devdocs.drift.com/docs/retrieving-contact
|
||||
if (operation === 'get') {
|
||||
const contactId = this.getNodeParameter('contactId', i) as string;
|
||||
responseData = await driftApiRequest.call(this, 'GET', `/contacts/${contactId}`);
|
||||
responseData = responseData.data
|
||||
responseData = responseData.data;
|
||||
}
|
||||
//https://devdocs.drift.com/docs/listing-custom-attributes
|
||||
if (operation === 'getCustomAttributes') {
|
||||
|
|
|
@ -42,7 +42,7 @@ export async function driftApiRequest(this: IExecuteFunctions | IWebhookFunction
|
|||
return await this.helpers.request!(options);
|
||||
} catch (error) {
|
||||
if (error.response) {
|
||||
const errorMessage = error.message || (error.response.body && error.response.body.message )
|
||||
const errorMessage = error.message || (error.response.body && error.response.body.message );
|
||||
throw new Error(`Drift error response [${error.statusCode}]: ${errorMessage}`);
|
||||
}
|
||||
throw error;
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 882 B |
|
@ -41,8 +41,8 @@
|
|||
"dist/credentials/CodaApi.credentials.js",
|
||||
"dist/credentials/CopperApi.credentials.js",
|
||||
"dist/credentials/DisqusApi.credentials.js",
|
||||
"dist/credentials/DropboxApi.credentials.js",
|
||||
"dist/credentials/DriftApi.credentials.js",
|
||||
"dist/credentials/DropboxApi.credentials.js",
|
||||
"dist/credentials/EventbriteApi.credentials.js",
|
||||
"dist/credentials/FreshdeskApi.credentials.js",
|
||||
"dist/credentials/FileMaker.credentials.js",
|
||||
|
@ -126,11 +126,11 @@
|
|||
"dist/nodes/Copper/CopperTrigger.node.js",
|
||||
"dist/nodes/Cron.node.js",
|
||||
"dist/nodes/Crypto.node.js",
|
||||
"dist/nodes/DateTime.node.js",
|
||||
"dist/nodes/Discord/Discord.node.js",
|
||||
"dist/nodes/Disqus/Disqus.node.js",
|
||||
"dist/nodes/Dropbox/Dropbox.node.js",
|
||||
"dist/nodes/DateTime.node.js",
|
||||
"dist/nodes/Drift/Drift.node.js",
|
||||
"dist/nodes/Dropbox/Dropbox.node.js",
|
||||
"dist/nodes/EditImage.node.js",
|
||||
"dist/nodes/EmailReadImap.node.js",
|
||||
"dist/nodes/EmailSend.node.js",
|
||||
|
|
Loading…
Reference in a new issue