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