refactor(core): Forbid raw enums (no-changelog)

This commit is contained in:
Michael Kret
2023-04-21 14:23:15 +03:00
committed by GitHub
parent da31925083
commit 0e93fe064e
39 changed files with 119 additions and 115 deletions

View File

@@ -13,7 +13,8 @@ import type {
import { todoistApiRequest } from '../GenericFunctions';
import { OperationType, TodoistService } from './Service';
import type { OperationType } from './Service';
import { TodoistService } from './Service';
// interface IBodyCreateTask {
// content?: string;
@@ -702,15 +703,11 @@ export class TodoistV1 implements INodeType {
const service = new TodoistService();
let responseData;
const resource = this.getNodeParameter('resource', 0);
const operation = this.getNodeParameter('operation', 0);
const operation = this.getNodeParameter('operation', 0) as OperationType;
for (let i = 0; i < length; i++) {
try {
if (resource === 'task') {
responseData = await service.execute(
this,
OperationType[operation as keyof typeof OperationType],
i,
);
responseData = await service.execute(this, operation, i);
}
if (Array.isArray(responseData?.data)) {
returnData.push.apply(returnData, responseData?.data as IDataObject[]);