🐛 Fix Clockify Trigger bug (#1778)

* Fix the empty results bug

* Fix return value
This commit is contained in:
MedAliMarz 2021-05-12 20:48:48 +02:00 committed by GitHub
parent c739a498f1
commit 6460ce3965
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,7 @@ export class ClockifyTrigger implements INodeType {
displayName: 'Clockify Trigger',
icon: 'file:clockify.png',
name: 'clockifyTrigger',
group: ['trigger'],
group: [ 'trigger' ],
version: 1,
description: 'Watches Clockify For Events',
defaults: {
@ -32,7 +32,7 @@ export class ClockifyTrigger implements INodeType {
color: '#000000',
},
inputs: [],
outputs: ['main'],
outputs: [ 'main' ],
credentials: [
{
name: 'clockifyApi',
@ -109,7 +109,7 @@ export class ClockifyTrigger implements INodeType {
qs.start = webhookData.lastTimeChecked;
qs.end = moment().tz(workflowTimezone).format('YYYY-MM-DDTHH:mm:ss') + 'Z';
qs.hydrated = true;
qs['in-progress'] = false;
qs[ 'in-progress' ] = false;
break;
}
@ -117,8 +117,8 @@ export class ClockifyTrigger implements INodeType {
webhookData.lastTimeChecked = qs.end;
if (Array.isArray(result) && result.length !== 0) {
result = [this.helpers.returnJsonArray(result)];
return [ this.helpers.returnJsonArray(result) ];
}
return result;
return null;
}
}