mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +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 MongoChat.findByIdAndUpdate(chatId, {
|
||||
...(customTitle ? { customTitle } : {}),
|
||||
...(top ? { top } : { top: null })
|
||||
await MongoChat.findOneAndUpdate({ chatId }, {
|
||||
...(customTitle && { customTitle }),
|
||||
...(top && { top })
|
||||
});
|
||||
jsonRes(res);
|
||||
} catch (err) {
|
||||
|
Reference in New Issue
Block a user