Fix: use document id for the flow

This commit is contained in:
Manoj K 2025-09-03 09:14:25 +05:30
parent 38f069a6dc
commit b701a11016

View File

@ -37,11 +37,16 @@ export const addToQueue = async (
},
});
let ingestionType = EpisodeType.CONVERSATION;
if (body.documentId) {
ingestionType = EpisodeType.DOCUMENT;
}
let handler;
if (body.type === EpisodeType.DOCUMENT) {
if (ingestionType === EpisodeType.DOCUMENT) {
handler = await ingestDocumentTask.trigger(
{
body,
body: { ...body, type: ingestionType },
userId,
workspaceId: user.Workspace.id,
queueId: queuePersist.id,
@ -52,10 +57,10 @@ export const addToQueue = async (
tags: [user.id, queuePersist.id],
},
);
} else if (body.type === EpisodeType.CONVERSATION) {
} else if (ingestionType === EpisodeType.CONVERSATION) {
handler = await ingestTask.trigger(
{
body,
body: { ...body, type: ingestionType },
userId,
workspaceId: user.Workspace.id,
queueId: queuePersist.id,