This commit is contained in:
archer
2023-07-17 10:20:30 +08:00
parent 98a5796592
commit 246283ee1c
46 changed files with 1747 additions and 780 deletions

View File

@@ -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(' ')
}
});