mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-22 07:01:07 +03:00
fix/import-missing-chat-data (#4401)
fix: add missing imports for messages and feedbacks in AgentFlow and AssistantFlow
This commit is contained in:
@@ -178,7 +178,11 @@ async function replaceDuplicateIdsForChatMessage(queryRunner: QueryRunner, origi
|
|||||||
const chatmessageChatflowIds = chatMessages.map((chatMessage) => {
|
const chatmessageChatflowIds = chatMessages.map((chatMessage) => {
|
||||||
return { id: chatMessage.chatflowid, qty: 0 }
|
return { id: chatMessage.chatflowid, qty: 0 }
|
||||||
})
|
})
|
||||||
const originalDataChatflowIds = originalData.ChatFlow.map((chatflow) => chatflow.id)
|
const originalDataChatflowIds = [
|
||||||
|
...originalData.AssistantFlow.map((assistantFlow) => assistantFlow.id),
|
||||||
|
...originalData.AgentFlow.map((agentflow) => agentflow.id),
|
||||||
|
...originalData.ChatFlow.map((chatflow) => chatflow.id)
|
||||||
|
]
|
||||||
chatmessageChatflowIds.forEach((item) => {
|
chatmessageChatflowIds.forEach((item) => {
|
||||||
if (originalDataChatflowIds.includes(item.id)) {
|
if (originalDataChatflowIds.includes(item.id)) {
|
||||||
item.qty += 1
|
item.qty += 1
|
||||||
@@ -229,7 +233,11 @@ async function replaceDuplicateIdsForChatMessageFeedback(
|
|||||||
const feedbackChatflowIds = chatMessageFeedbacks.map((feedback) => {
|
const feedbackChatflowIds = chatMessageFeedbacks.map((feedback) => {
|
||||||
return { id: feedback.chatflowid, qty: 0 }
|
return { id: feedback.chatflowid, qty: 0 }
|
||||||
})
|
})
|
||||||
const originalDataChatflowIds = originalData.ChatFlow.map((chatflow) => chatflow.id)
|
const originalDataChatflowIds = [
|
||||||
|
...originalData.AssistantFlow.map((assistantFlow) => assistantFlow.id),
|
||||||
|
...originalData.AgentFlow.map((agentflow) => agentflow.id),
|
||||||
|
...originalData.ChatFlow.map((chatflow) => chatflow.id)
|
||||||
|
]
|
||||||
feedbackChatflowIds.forEach((item) => {
|
feedbackChatflowIds.forEach((item) => {
|
||||||
if (originalDataChatflowIds.includes(item.id)) {
|
if (originalDataChatflowIds.includes(item.id)) {
|
||||||
item.qty += 1
|
item.qty += 1
|
||||||
|
|||||||
Reference in New Issue
Block a user