From ea5f66978b702098bf574bcd3ed9c4e7e9de3694 Mon Sep 17 00:00:00 2001 From: Neha Prasad Date: Thu, 31 Jul 2025 00:49:27 +0530 Subject: [PATCH] fix: API export-chats endpoint function import error (#4220) fix: resolve prepareWorkspaceChatsForExport function not found error in API export-chats endpoint --- server/endpoints/api/system/index.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/server/endpoints/api/system/index.js b/server/endpoints/api/system/index.js index f6b9f511..a9c1a5e0 100644 --- a/server/endpoints/api/system/index.js +++ b/server/endpoints/api/system/index.js @@ -2,10 +2,7 @@ const { EventLogs } = require("../../../models/eventLogs"); const { SystemSettings } = require("../../../models/systemSettings"); const { purgeDocument } = require("../../../utils/files/purgeDocument"); const { getVectorDbClass } = require("../../../utils/helpers"); -const { - prepareWorkspaceChatsForExport, - exportChatsAsType, -} = require("../../../utils/helpers/chat/convertTo"); +const { exportChatsAsType } = require("../../../utils/helpers/chat/convertTo"); const { dumpENV, updateENV } = require("../../../utils/helpers/updateENV"); const { reqBody } = require("../../../utils/http"); const { validApiKey } = require("../../../utils/middleware/validApiKey"); @@ -192,8 +189,10 @@ function apiSystemEndpoints(app) { */ try { const { type = "jsonl" } = request.query; - const chats = await prepareWorkspaceChatsForExport(type); - const { contentType, data } = await exportChatsAsType(chats, type); + const { contentType, data } = await exportChatsAsType( + type, + "workspace" + ); await EventLogs.logEvent("exported_chats", { type, });