mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Merge pull request #18374 from overleaf/em-chat-resolved-thread-ids
Add resolved-thread-ids endpoint to chat GitOrigin-RevId: 211dee88707f2d7fb1c0c8805a1f6ac28dca494d
This commit is contained in:
@@ -109,3 +109,18 @@ export async function deleteAllThreadsInProject(projectId) {
|
||||
project_id: new ObjectId(projectId.toString()),
|
||||
})
|
||||
}
|
||||
|
||||
export async function getResolvedThreadIds(projectId) {
|
||||
const resolvedThreadIds = await db.rooms
|
||||
.find(
|
||||
{
|
||||
project_id: new ObjectId(projectId),
|
||||
thread_id: { $exists: true },
|
||||
resolved: { $exists: true },
|
||||
},
|
||||
{ projection: { thread_id: 1 } }
|
||||
)
|
||||
.map(record => record.thread_id.toString())
|
||||
.toArray()
|
||||
return resolvedThreadIds
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user