mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
fix: clearConvo will remove all messages
This commit is contained in:
parent
7d43032a98
commit
d8ccc5b870
1 changed files with 6 additions and 10 deletions
|
|
@ -45,13 +45,9 @@ module.exports = {
|
|||
},
|
||||
updateConvo: async (user, { conversationId, ...update }) => {
|
||||
try {
|
||||
return await Conversation.findOneAndUpdate(
|
||||
{ conversationId: conversationId, user },
|
||||
update,
|
||||
{
|
||||
new: true
|
||||
}
|
||||
).exec();
|
||||
return await Conversation.findOneAndUpdate({ conversationId: conversationId, user }, update, {
|
||||
new: true
|
||||
}).exec();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return { message: 'Error updating conversation' };
|
||||
|
|
@ -89,7 +85,7 @@ module.exports = {
|
|||
promises.push(
|
||||
Conversation.findOne({
|
||||
user,
|
||||
conversationId: convo.conversationId,
|
||||
conversationId: convo.conversationId
|
||||
}).exec()
|
||||
)
|
||||
);
|
||||
|
|
@ -143,13 +139,13 @@ module.exports = {
|
|||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return 'Error getting conversation title';
|
||||
return { message: 'Error getting conversation title' };
|
||||
}
|
||||
},
|
||||
deleteConvos: async (user, filter) => {
|
||||
let deleteCount = await Conversation.deleteMany({ ...filter, user }).exec();
|
||||
console.log('deleteCount', deleteCount);
|
||||
deleteCount.messages = await deleteMessages(filter);
|
||||
deleteCount.messages = await deleteMessages({ ...filter, user });
|
||||
return deleteCount;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue