mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 17:30:16 +01:00
feat: clean up comments and improve code readability in favorites and agent components; bump @librechat/data-schemas to 0.0.24
This commit is contained in:
parent
4e4a132660
commit
bfeae91a96
9 changed files with 55 additions and 52 deletions
|
|
@ -37,10 +37,8 @@ const getFavoritesController = async (req, res) => {
|
|||
|
||||
let favorites = user.favorites || [];
|
||||
|
||||
// Ensure favorites is an array (migration/dev fix)
|
||||
if (!Array.isArray(favorites)) {
|
||||
favorites = [];
|
||||
// Optionally update the DB to fix it permanently
|
||||
await User.findByIdAndUpdate(userId, { $set: { favorites: [] } });
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue