feat: kb ui

This commit is contained in:
archer
2023-07-14 11:49:36 +08:00
parent 358c4716f9
commit 5a96e167ee
24 changed files with 463 additions and 412 deletions

View File

@@ -18,10 +18,13 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
await connectToDatabase();
const data = await KB.findOne({
_id: id,
userId
});
const data = await KB.findOne(
{
_id: id,
userId
},
'_id avatar name userId tags'
);
if (!data) {
throw new Error('kb is not exist');
@@ -33,7 +36,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
avatar: data.avatar,
name: data.name,
userId: data.userId,
updateTime: data.updateTime,
tags: data.tags.join(' ')
}
});