fix: img compress (#546)

This commit is contained in:
Archer
2023-12-03 23:56:45 +08:00
committed by GitHub
parent 7fc05af09e
commit 9c77dfbddd
6 changed files with 14 additions and 7 deletions

View File

@@ -13,10 +13,13 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
await authChat({ req, authToken: true, chatId });
await MongoChat.findOneAndUpdate({ chatId }, {
...(customTitle && { customTitle }),
...(top && { top })
});
await MongoChat.findOneAndUpdate(
{ chatId },
{
...(customTitle !== undefined && { customTitle }),
...(top !== undefined && { top })
}
);
jsonRes(res);
} catch (err) {
jsonRes(res, {