Fix critical bugs: SQL query, navigation, and Surface overflow warnings
This commit is contained in:
@ -63,12 +63,12 @@ export class ConversationsService {
|
||||
const subQuery = qb.subQuery()
|
||||
.select('c.id')
|
||||
.from('conversations', 'c')
|
||||
.leftJoin('conversation_participants', 'cp1', 'cp1.conversationId = c.id')
|
||||
.leftJoin('conversation_participants', 'cp2', 'cp2.conversationId = c.id')
|
||||
.leftJoin('conversation_participants', 'cp1', 'cp1."conversationId" = c.id')
|
||||
.leftJoin('conversation_participants', 'cp2', 'cp2."conversationId" = c.id')
|
||||
.where('c.isGroup = false')
|
||||
.andWhere('cp1.userId = :user1Id', { user1Id })
|
||||
.andWhere('cp2.userId = :user2Id', { user2Id })
|
||||
.andWhere('(SELECT COUNT(*) FROM conversation_participants WHERE conversationId = c.id) = 2')
|
||||
.andWhere('cp1."userId" = :user1Id', { user1Id })
|
||||
.andWhere('cp2."userId" = :user2Id', { user2Id })
|
||||
.andWhere('(SELECT COUNT(*) FROM conversation_participants WHERE "conversationId" = c.id) = 2')
|
||||
.getQuery();
|
||||
return 'conversation.id IN ' + subQuery;
|
||||
})
|
||||
|
Reference in New Issue
Block a user