perf: bill

This commit is contained in:
archer
2023-07-17 13:35:30 +08:00
parent f546068354
commit 60a9dfb55f
10 changed files with 129 additions and 56 deletions

View File

@@ -9,7 +9,7 @@ import { UserUpdateParams } from '@/types/user';
/* 更新一些基本信息 */
export default async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
try {
const { openaiKey, avatar } = req.body as UserUpdateParams;
const { avatar } = req.body as UserUpdateParams;
const { userId } = await authUser({ req, authToken: true });
@@ -20,8 +20,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
_id: userId
},
{
...(avatar && { avatar }),
...(openaiKey !== undefined && { openaiKey })
...(avatar && { avatar })
}
);