fetchhistory changes
Deploy Node App / deploy (push) Successful in 9s

This commit is contained in:
Gitea
2026-06-03 11:25:01 +05:30
parent fe5a10d1fc
commit be6e3f597d
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ const fetchHistory = async (req, res) => {
const fetchUserHistory = async (req, res) => { const fetchUserHistory = async (req, res) => {
try { try {
const userId = req.user?.client_id || null; const userId = req.user?.userid || null;
const rows = await clickhouse.query({ const rows = await clickhouse.query({
query: ` query: `
+1 -1
View File
@@ -321,7 +321,7 @@ const ask = async (req, res) => {
try { try {
const { prompt } = req.body; const { prompt } = req.body;
const userId = req.user?.client_id || null; const userId = req.user?.userid || null;
if (!prompt?.trim()) { if (!prompt?.trim()) {
return res.status(400).json({ return res.status(400).json({
+1
View File
@@ -41,6 +41,7 @@ const loginUser = async (req, res) => {
const token = jwt.sign( const token = jwt.sign(
{ {
client_id: user.client_id, client_id: user.client_id,
userid: user.userid,
username: user.username username: user.username
}, },
JWT_SECRET, JWT_SECRET,