-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: custom chat title #534
Conversation
Apply Sweep Rules to your PR?
|
...(customTitle ? { customTitle } : {}), | ||
...(top ? { top } : { top: null }) | ||
}); | ||
},{ new: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不能使用new
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
确实,当时为了调试输出用的,是删掉new就通过了?
目前是使用findByIdAndUpdate没正确更新titile,刷新就会重新读取title,使用findOneAndUpdate({ chatId: chatId }这样的方式也不正确吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
findOneAndUpdate是正确的,因为chatId是个独立的属性。但是不需要后面的new true,否则有可能创建脏数据。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
确实,当时为了调试输出用的,是删掉new就通过了?
目前是使用findByIdAndUpdate没正确更新titile,刷新就会重新读取title,使用findOneAndUpdate({ chatId: chatId }这样的方式也不正确吗?
可以修改下再push下
Fix: Update Custom Chat Title Based on chatId