feat: simplify handler parameter destructuring in debug.ts
This commit is contained in:
@@ -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 */
|
||||||
|
|||||||
Reference in New Issue
Block a user