add handle when import file array length is 0

pull/2796/head
chungyau97 2024-07-14 14:47:52 +08:00
parent 1dc98b11dc
commit 43a3db40db
1 changed files with 2 additions and 0 deletions

View File

@ -201,6 +201,8 @@ const importChatflows = async (newChatflows: Partial<ChatFlow>[]): Promise<any>
try {
const appServer = getRunningExpressApp()
if (newChatflows.length == 0) throw new Error('No chatflows in this file.')
// step 1 - check whether there are any contradict id
let ids = '('
let count: number = 0