@@ -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: `
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user