Skip to content

Commit 7e7a555

Browse files
author
Taner TEMEL
committed
TimelineNode
1 parent a9cd932 commit 7e7a555

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎nodes/Timeline/Timeline.node.ts‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
import { NodeConnectionTypes } from 'n8n-workflow';
88
import { getSenders } from '../HaiiloApi/sender/getSenders';
99
import { haiiloApiRequest } from '../HaiiloApi/shared/transport';
10+
import { getMe } from '../HaiiloApi/user/me';
1011

1112
export class Timeline implements INodeType {
1213
description: INodeTypeDescription = {
@@ -55,20 +56,24 @@ export class Timeline implements INodeType {
5556
const input = this.getInputData();
5657
const returnData: INodeExecutionData[] = [];
5758
for (let i = 0; i < input.length; i++) {
59+
5860
const timelineMessage = this.getNodeParameter('timelineMessage', i) as string;
61+
62+
const me = await getMe(this);
63+
5964
const post = {
60-
recipientIds: ['10a9e5b4-f3b3-4a42-b244-498080480d70'],
65+
recipientIds: [me.id],
6166
restricted: false,
6267
webPreviews: {},
6368
stickyExpiry: null,
6469
type: 'post',
65-
authorId: '10a9e5b4-f3b3-4a42-b244-498080480d70',
70+
authorId: me.id,
6671
data: { message: timelineMessage },
6772
attachments: [],
6873
fileLibraryAttachments: [],
6974
};
7075
console.log(post);
71-
const response = await haiiloApiRequest.call(this, 'POST', '/timeline-items', post);
76+
const response = await haiiloApiRequest.call(this, 'POST', '/timeline-items', {}, post);
7277
returnData.push({ json: response.content ?? [] });
7378
}
7479
return [returnData];

0 commit comments

Comments
 (0)