mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-25 20:02:47 +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:
parent
a9ae270335
commit
7fc05af09e
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue