mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
🧹 chore: pre-release cleanup (#3595)
* fix: Update health endpoint URL * refactor: use Constants for saved tag default value, do not place Saved as first always * refactor: check trimmed currentText before appending parsedText in useSubmitMessage * refactor: move `scrollToEnd()` to `createdHandler` and increase delay before execution slightly * chore: Add back TypeScript linting rules for unnecessary conditions and strict boolean expressions * chore: Update librechat-data-provider package.json version to 0.7.4.0
This commit is contained in:
parent
e05a6d306d
commit
473859b0e2
11 changed files with 16 additions and 25 deletions
|
|
@ -2,8 +2,6 @@ const ConversationTag = require('./schema/conversationTagSchema');
|
|||
const Conversation = require('./schema/convoSchema');
|
||||
const logger = require('~/config/winston');
|
||||
|
||||
const SAVED_TAG = 'Saved';
|
||||
|
||||
/**
|
||||
* Retrieves all conversation tags for a user.
|
||||
* @param {string} user - The user ID.
|
||||
|
|
@ -11,19 +9,7 @@ const SAVED_TAG = 'Saved';
|
|||
*/
|
||||
const getConversationTags = async (user) => {
|
||||
try {
|
||||
const cTags = await ConversationTag.find({ user }).sort({ position: 1 }).lean();
|
||||
|
||||
cTags.sort((a, b) => {
|
||||
if (a.tag === SAVED_TAG) {
|
||||
return -1;
|
||||
}
|
||||
if (b.tag === SAVED_TAG) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
return cTags;
|
||||
return await ConversationTag.find({ user }).sort({ position: 1 }).lean();
|
||||
} catch (error) {
|
||||
logger.error('[getConversationTags] Error getting conversation tags', error);
|
||||
throw new Error('Error getting conversation tags');
|
||||
|
|
@ -248,7 +234,6 @@ const updateTagsForConversation = async (user, conversationId, tags) => {
|
|||
};
|
||||
|
||||
module.exports = {
|
||||
SAVED_TAG,
|
||||
getConversationTags,
|
||||
createConversationTag,
|
||||
updateConversationTag,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue