mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
convo fetching in increments of 12
This commit is contained in:
parent
80319c7fcc
commit
a98367d27f
6 changed files with 70 additions and 16 deletions
|
|
@ -73,7 +73,19 @@ module.exports = {
|
|||
return { message: 'Error updating conversation' };
|
||||
}
|
||||
},
|
||||
getConvos: async () => await Conversation.find({}).sort({ created: -1 }).exec(),
|
||||
// getConvos: async () => await Conversation.find({}).sort({ created: -1 }).exec(),
|
||||
getConvos: async (pageNumber = 1, pageSize = 12) => {
|
||||
// const skip = (pageNumber - 1) * pageSize;
|
||||
const limit = pageNumber * pageSize;
|
||||
|
||||
const conversations = await Conversation.find({})
|
||||
.sort({ created: -1 })
|
||||
// .skip(skip)
|
||||
.limit(limit)
|
||||
.exec();
|
||||
|
||||
return conversations;
|
||||
},
|
||||
deleteConvos: async (filter) => {
|
||||
let deleteCount = await Conversation.deleteMany(filter).exec();
|
||||
deleteCount.messages = await deleteMessages(filter);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue