mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 17:30:16 +01:00
feat: Implement error handling for favorites limit and consolidate marketplace access logic
This commit is contained in:
parent
1ed0ae9de4
commit
92f80f3aaa
8 changed files with 80 additions and 72 deletions
|
|
@ -17,7 +17,11 @@ const updateFavoritesController = async (req, res) => {
|
|||
}
|
||||
|
||||
if (favorites.length > MAX_FAVORITES) {
|
||||
return res.status(400).json({ message: `Maximum ${MAX_FAVORITES} favorites allowed` });
|
||||
return res.status(400).json({
|
||||
code: 'MAX_FAVORITES_EXCEEDED',
|
||||
message: `Maximum ${MAX_FAVORITES} favorites allowed`,
|
||||
limit: MAX_FAVORITES,
|
||||
});
|
||||
}
|
||||
|
||||
for (const fav of favorites) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue