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:
Marco Beretta 2025-11-23 23:44:35 +01:00
parent 4e4a132660
commit bfeae91a96
No known key found for this signature in database
GPG key ID: D918033D8E74CC11
9 changed files with 55 additions and 52 deletions

View file

@ -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: [] } });
}