feat: simplify handler parameter destructuring in debug.ts

This commit is contained in:
sd0ric4
2025-03-26 17:28:30 +08:00
parent dfc0dd5834
commit 6ddf5d0094

View File

@@ -23,10 +23,7 @@ async function handler(
appId, appId,
query: requestQuery, query: requestQuery,
history: requestHistories history: requestHistories
} = req.body as PostWorkflowDebugProps & { } = req.body as PostWorkflowDebugProps;
query?: UserChatItemValueItemType[];
history?: ChatItemType[];
};
if (!nodes) { if (!nodes) {
throw new Error('Prams Error'); throw new Error('Prams Error');
@@ -42,10 +39,7 @@ async function handler(
throw new Error('No entry node found'); throw new Error('No entry node found');
} }
const isEntryNodeInteractive = const histories: ChatItemType[] = requestHistories || [];
entryNode.flowNodeType === 'formInput' || entryNode.flowNodeType === 'userSelect';
const histories: ChatItemType[] = isEntryNodeInteractive ? requestHistories || [] : [];
const query: UserChatItemValueItemType[] = requestQuery || []; const query: UserChatItemValueItemType[] = requestQuery || [];
/* user auth */ /* user auth */