Bugfix/Undefined Flowdata (#2116)

add fix for undefined flowdata
This commit is contained in:
Henry Heng
2024-04-07 12:01:57 +01:00
committed by GitHub
parent 658fa3984e
commit 19e14c4798
2 changed files with 6 additions and 2 deletions
@@ -114,11 +114,14 @@ const updateChatflow = async (req: Request, res: Response, next: NextFunction) =
if (!chatflow) {
return res.status(404).send(`Chatflow ${req.params.id} not found`)
}
const body = req.body
const updateChatFlow = new ChatFlow()
Object.assign(updateChatFlow, body)
updateChatFlow.id = chatflow.id
createRateLimiter(updateChatFlow)
const apiResponse = await chatflowsService.updateChatflow(chatflow, updateChatFlow)
return res.json(apiResponse)
} catch (error) {