Merge pull request #18710 from overleaf/mj-web-chat-send-thread-data

[chat+web] Inform frontend when duplicating threads

GitOrigin-RevId: 285afee8f5a016a8e7ac58e9538cc3ec8362681d
This commit is contained in:
Mathias Jakobsen
2024-06-10 08:04:25 +00:00
committed by Copybot
parent 0f869f9059
commit 110b83aea0
11 changed files with 312 additions and 158 deletions
@@ -146,3 +146,12 @@ export async function duplicateThread(projectId, threadId) {
newRoom._id = confirmation.insertedId
return { oldRoom: room, newRoom }
}
export async function findThreadsById(projectId, threadIds) {
return await db.rooms
.find({
project_id: new ObjectId(projectId),
thread_id: { $in: threadIds.map(id => new ObjectId(id)) },
})
.toArray()
}