Skip to content

Commit

Permalink
refactor: Fix type errors in completions code (#9439)
Browse files Browse the repository at this point in the history
  • Loading branch information
elsmr authored May 17, 2024
1 parent db1a406 commit feba07b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 73 deletions.
8 changes: 4 additions & 4 deletions packages/editor-ui/src/composables/useWorkflowHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import type { useRouter } from 'vue-router';
import { useTelemetry } from '@/composables/useTelemetry';
import { useProjectsStore } from '@/features/projects/projects.store';

export function resolveParameter(
export function resolveParameter<T = IDataObject>(
parameter: NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[],
opts: {
targetItem?: TargetItem;
Expand All @@ -79,7 +79,7 @@ export function resolveParameter(
additionalKeys?: IWorkflowDataProxyAdditionalKeys;
isForCredential?: boolean;
} = {},
): IDataObject | null {
): T | null {
let itemIndex = opts?.targetItem?.itemIndex || 0;

const workflow = getCurrentWorkflow();
Expand Down Expand Up @@ -115,7 +115,7 @@ export function resolveParameter(
false,
undefined,
'',
) as IDataObject;
) as T;
}

const inputName = NodeConnectionType.Main;
Expand Down Expand Up @@ -235,7 +235,7 @@ export function resolveParameter(
false,
{},
contextNode!.name,
) as IDataObject;
) as T;
}

export function resolveRequiredParameters(
Expand Down
Loading

0 comments on commit feba07b

Please sign in to comment.