mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-03 13:38:00 +00:00
kb
This commit is contained in:
@@ -18,13 +18,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
|
||||
|
||||
await connectToDatabase();
|
||||
|
||||
const data = await KB.findOne(
|
||||
{
|
||||
_id: id,
|
||||
userId
|
||||
},
|
||||
'_id avatar name userId tags'
|
||||
);
|
||||
const data = await KB.findOne({
|
||||
_id: id,
|
||||
userId
|
||||
});
|
||||
|
||||
if (!data) {
|
||||
throw new Error('kb is not exist');
|
||||
@@ -36,6 +33,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
|
||||
avatar: data.avatar,
|
||||
name: data.name,
|
||||
userId: data.userId,
|
||||
model: data.model,
|
||||
tags: data.tags.join(' ')
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user