mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-17 08:37:59 +00:00
fix: custom chat title (#534)
* Fix: Update Custom Chat Title Based on chatId * remove `new:true` option * Update update.ts --------- Co-authored-by: Archer <545436317@qq.com>
This commit is contained in:
@@ -13,9 +13,9 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||||||
|
|
||||||
await authChat({ req, authToken: true, chatId });
|
await authChat({ req, authToken: true, chatId });
|
||||||
|
|
||||||
await MongoChat.findByIdAndUpdate(chatId, {
|
await MongoChat.findOneAndUpdate({ chatId }, {
|
||||||
...(customTitle ? { customTitle } : {}),
|
...(customTitle && { customTitle }),
|
||||||
...(top ? { top } : { top: null })
|
...(top && { top })
|
||||||
});
|
});
|
||||||
jsonRes(res);
|
jsonRes(res);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
Reference in New Issue
Block a user