From bea7933c4822ac91028e550d317051a2b7ef21b7 Mon Sep 17 00:00:00 2001 From: Gitea Date: Mon, 15 Jun 2026 16:18:45 +0530 Subject: [PATCH] structure ready --- controller/askQuestion.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/controller/askQuestion.js b/controller/askQuestion.js index bac1d4e..eede1d6 100644 --- a/controller/askQuestion.js +++ b/controller/askQuestion.js @@ -207,6 +207,10 @@ const askstream = async (req, res) => { if (!results.length) { + const result = await postgre.query( + 'insert into useraskquestion (user_id, questions) values ($1, $2)', + [user_id, question] + ); send("token", { token: "❌", isWord: true }); send("token", { token: "I", isWord: true }); send("token", { token: "could", isWord: true }); @@ -220,10 +224,7 @@ const askstream = async (req, res) => { send("token", { token: "documents.", isWord: true }); send("done", { sources: [] }); - const result = await postgre.query( - 'insert into useraskquestion (user_id, questions) values ($1, $2)', - [user_id, question] - ); + return res.end(); }