From d10dce0ccb24f6a41cfb59eb2a14f026d16a5b04 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 17 Jun 2023 09:57:26 +0100 Subject: [PATCH] add first chat message not found from API call --- packages/server/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index b248f22cc..40bd75cd2 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -507,8 +507,8 @@ export class App { }) if (!chatflow) return res.status(404).send(`Chatflow ${chatflowid} not found`) - const chatId = await getChatId(chatflow.id) - if (!chatId) return res.status(500).send(`Chatflow ${chatflowid} first message not found`) + let chatId = await getChatId(chatflow.id) + if (!chatId) chatId = Date.now().toString() if (!isInternal) { await this.validateKey(req, res, chatflow)