mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-10 20:48:54 +01:00
convo successfully changes on convo click
This commit is contained in:
parent
d35ed31b20
commit
c7c50dbbab
9 changed files with 76 additions and 25 deletions
|
|
@ -1,5 +1,5 @@
|
|||
const mongoose = require('mongoose');
|
||||
const { Message } = require('./Message');
|
||||
const { getMessages } = require('./Message');
|
||||
|
||||
const convoSchema = mongoose.Schema({
|
||||
conversationId: {
|
||||
|
|
@ -27,7 +27,7 @@ const Conversation =
|
|||
|
||||
module.exports = {
|
||||
saveConversation: async ({ conversationId, parentMessageId, title }) => {
|
||||
const messages = await Message.find({ conversationId }).exec();
|
||||
const messages = await getMessages({ conversationId });
|
||||
const update = { parentMessageId, messages };
|
||||
if (title) {
|
||||
update.title = title;
|
||||
|
|
|
|||
|
|
@ -40,5 +40,5 @@ module.exports = {
|
|||
text
|
||||
});
|
||||
},
|
||||
Message,
|
||||
getMessages: async (filter) => await Message.find(filter).exec(),
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
require('dotenv').config();
|
||||
const mongoose = require('mongoose');
|
||||
const MONGO_URI = process.env.MONGO_URI;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue