From be6e3f597d97d66314eab3f5d6c167ad0b8fdcb2 Mon Sep 17 00:00:00 2001 From: Gitea Date: Wed, 3 Jun 2026 11:25:01 +0530 Subject: [PATCH] fetchhistory changes --- controller/fetchhistory.js | 2 +- controller/handleOrchestration.js | 2 +- controller/loginUser.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/controller/fetchhistory.js b/controller/fetchhistory.js index b1ca8ee..7ca0368 100644 --- a/controller/fetchhistory.js +++ b/controller/fetchhistory.js @@ -46,7 +46,7 @@ const fetchHistory = async (req, res) => { const fetchUserHistory = async (req, res) => { try { - const userId = req.user?.client_id || null; + const userId = req.user?.userid || null; const rows = await clickhouse.query({ query: ` diff --git a/controller/handleOrchestration.js b/controller/handleOrchestration.js index f410673..7461cdd 100644 --- a/controller/handleOrchestration.js +++ b/controller/handleOrchestration.js @@ -321,7 +321,7 @@ const ask = async (req, res) => { try { const { prompt } = req.body; - const userId = req.user?.client_id || null; + const userId = req.user?.userid || null; if (!prompt?.trim()) { return res.status(400).json({ diff --git a/controller/loginUser.js b/controller/loginUser.js index 56b6327..817a153 100644 --- a/controller/loginUser.js +++ b/controller/loginUser.js @@ -40,7 +40,8 @@ const loginUser = async (req, res) => { const token = jwt.sign( { - client_id: user.client_id, + client_id: user.client_id, + userid: user.userid, username: user.username }, JWT_SECRET,