🐛 Fix bug in Zendesk Trigger node with wrong conditions (#1668)

This commit is contained in:
Bart Vollebregt 2021-04-17 17:08:07 +02:00 committed by GitHub
parent e46242faf5
commit c80b0ebfd9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -442,11 +442,11 @@ export class ZendeskTrigger implements INodeType {
const conditionsAll = conditions.all as [IDataObject]; const conditionsAll = conditions.all as [IDataObject];
let endpoint = ''; let endpoint = '';
const aux: IDataObject = {};
const resultAll = [], resultAny = []; const resultAll = [], resultAny = [];
if (conditionsAll) { if (conditionsAll) {
for (const conditionAll of conditionsAll) { for (const conditionAll of conditionsAll) {
const aux: IDataObject = {};
aux.field = conditionAll.field; aux.field = conditionAll.field;
aux.operator = conditionAll.operation; aux.operator = conditionAll.operation;
if (conditionAll.operation !== 'changed' if (conditionAll.operation !== 'changed'
@ -462,6 +462,7 @@ export class ZendeskTrigger implements INodeType {
const conditionsAny = conditions.any as [IDataObject]; const conditionsAny = conditions.any as [IDataObject];
if (conditionsAny) { if (conditionsAny) {
for (const conditionAny of conditionsAny) { for (const conditionAny of conditionsAny) {
const aux: IDataObject = {};
aux.field = conditionAny.field; aux.field = conditionAny.field;
aux.operator = conditionAny.operation; aux.operator = conditionAny.operation;
if (conditionAny.operation !== 'changed' if (conditionAny.operation !== 'changed'
@ -510,7 +511,6 @@ export class ZendeskTrigger implements INodeType {
const webhookData = this.getWorkflowStaticData('node'); const webhookData = this.getWorkflowStaticData('node');
const service = this.getNodeParameter('service') as string; const service = this.getNodeParameter('service') as string;
if (service === 'support') { if (service === 'support') {
const aux: IDataObject = {};
const message: IDataObject = {}; const message: IDataObject = {};
const resultAll = [], resultAny = []; const resultAll = [], resultAny = [];
const conditions = this.getNodeParameter('conditions') as IDataObject; const conditions = this.getNodeParameter('conditions') as IDataObject;
@ -530,6 +530,7 @@ export class ZendeskTrigger implements INodeType {
const conditionsAll = conditions.all as [IDataObject]; const conditionsAll = conditions.all as [IDataObject];
if (conditionsAll) { if (conditionsAll) {
for (const conditionAll of conditionsAll) { for (const conditionAll of conditionsAll) {
const aux: IDataObject = {};
aux.field = conditionAll.field; aux.field = conditionAll.field;
aux.operator = conditionAll.operation; aux.operator = conditionAll.operation;
if (conditionAll.operation !== 'changed' if (conditionAll.operation !== 'changed'
@ -544,6 +545,7 @@ export class ZendeskTrigger implements INodeType {
const conditionsAny = conditions.any as [IDataObject]; const conditionsAny = conditions.any as [IDataObject];
if (conditionsAny) { if (conditionsAny) {
for (const conditionAny of conditionsAny) { for (const conditionAny of conditionsAny) {
const aux: IDataObject = {};
aux.field = conditionAny.field; aux.field = conditionAny.field;
aux.operator = conditionAny.operation; aux.operator = conditionAny.operation;
if (conditionAny.operation !== 'changed' if (conditionAny.operation !== 'changed'