mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
fix(HelpScout Node): Fix issue with thread types not working correctly (#10084)
This commit is contained in:
parent
76c290655d
commit
68d3bebfee
|
@ -459,6 +459,13 @@ export class HelpScout implements INodeType {
|
|||
const text = this.getNodeParameter('text', i) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const attachments = this.getNodeParameter('attachmentsUi', i) as IDataObject;
|
||||
let threadType = this.getNodeParameter('type', i) as string;
|
||||
|
||||
// We need to update the types to match the API - Avoids a breaking change
|
||||
const singular = ['reply', 'customer'];
|
||||
if (!singular.includes(threadType)) {
|
||||
threadType = `${threadType}s`;
|
||||
}
|
||||
const body: IThread = {
|
||||
text,
|
||||
attachments: [],
|
||||
|
@ -527,7 +534,7 @@ export class HelpScout implements INodeType {
|
|||
responseData = await helpscoutApiRequest.call(
|
||||
this,
|
||||
'POST',
|
||||
`/v2/conversations/${conversationId}/chats`,
|
||||
`/v2/conversations/${conversationId}/${threadType}`,
|
||||
body,
|
||||
);
|
||||
responseData = { success: true };
|
||||
|
|
Loading…
Reference in a new issue