Files
Automata/packages/nodes-base/nodes/Microsoft/Teams/v2/actions/task/get.operation.ts
Michael Kret 2c146cca62 feat(Microsoft Teams Node): Overhaul (#7477)
Co-authored-by: Giulio Andreini <andreini@netseven.it>
2024-01-22 18:35:09 +02:00

32 lines
907 B
TypeScript

import type { INodeProperties, IExecuteFunctions } from 'n8n-workflow';
import { updateDisplayOptions } from '@utils/utilities';
import { microsoftApiRequest } from '../../transport';
const properties: INodeProperties[] = [
{
displayName: 'Task ID',
name: 'taskId',
required: true,
type: 'string',
description: 'The ID of the task to retrieve',
placeholder: 'e.g. h3ufgLvXPkSRzYm-zO5cY5gANtBQ',
default: '',
},
];
const displayOptions = {
show: {
resource: ['task'],
operation: ['get'],
},
};
export const description = updateDisplayOptions(displayOptions, properties);
export async function execute(this: IExecuteFunctions, i: number) {
//https://docs.microsoft.com/en-us/graph/api/plannertask-get?view=graph-rest-1.0&tabs=http
const taskId = this.getNodeParameter('taskId', i) as string;
return await microsoftApiRequest.call(this, 'GET', `/v1.0/planner/tasks/${taskId}`);
}