Commit d3510846 by archer

fix: openapi key unsave

parent d807f9d0
......@@ -14,7 +14,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
const userId = await authToken(req);
await connectToDatabase();
// 更新对应的记录
await User.updateOne(
{
......@@ -22,7 +21,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
},
{
...(avatar && { avatar }),
...(openaiKey && { openaiKey })
...(openaiKey !== undefined && { openaiKey })
}
);
......
......@@ -61,6 +61,7 @@ const NumberSetting = () => {
maxH: 60
});
onclickSave({
...userInfo,
avatar: base64
});
} catch (err: any) {
......@@ -70,7 +71,7 @@ const NumberSetting = () => {
});
}
},
[onclickSave, toast]
[onclickSave, toast, userInfo]
);
const onclickLogOut = useCallback(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment