fix/import-missing-chat-data (#4401)
fix: add missing imports for messages and feedbacks in AgentFlow and AssistantFlow
This commit is contained in:
parent
e467d0615c
commit
82e6f43b5c
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue