fix(core): Revert custom API option injecting (#5345)

Revert "feat(core): Fix populating of node custom api call options (#5303)"

This reverts commit e58bc41d24.
This commit is contained in:
OlegIvaniv
2023-02-02 20:03:45 +01:00
committed by GitHub
parent b5154d9be5
commit 616074158c
8 changed files with 85 additions and 78 deletions

View File

@@ -56,12 +56,9 @@ const customNodeActionsParsers: {
},
};
function filterActions(actions: INodeActionTypeDescription[]) {
function filterSinglePlaceholderAction(actions: INodeActionTypeDescription[]) {
return actions.filter(
(action: INodeActionTypeDescription, _: number, arr: INodeActionTypeDescription[]) => {
const isApiCall = action.actionKey === CUSTOM_API_CALL_KEY;
if (isApiCall) return false;
const isPlaceholderTriggerAction = action.actionKey === PLACEHOLDER_RECOMMENDED_ACTION_KEY;
return !isPlaceholderTriggerAction || (isPlaceholderTriggerAction && arr.length > 1);
},
@@ -342,7 +339,7 @@ export const useNodeCreatorStore = defineStore(STORES.NODE_CREATOR, {
const filteredNodes = Object.values(mergedNodes).map((node) => ({
...node,
actions: filterActions(node.actions || []),
actions: filterSinglePlaceholderAction(node.actions || []),
}));
return filteredNodes;