Skip to content

Commit

Permalink
Feat : 채팅 페이지네이션 분리 및 주석처리
Browse files Browse the repository at this point in the history
  • Loading branch information
namewhat99 committed Jan 14, 2024
1 parent de92ad7 commit c10de5a
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions BE/src/chat/chat.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,22 +217,26 @@ export class ChatService {
.execute();
}

/*async getRoomAndChatInfoPagination(roomId: number, chatId: number) {
return await this.chatRoomRepository
.createQueryBuilder('chat_room')
.innerJoinAndSelect('chat_room.chats', 'chat_info')
.innerJoinAndSelect('chat_room.writerUser', 'writer')
.innerJoinAndSelect('chat_room.userUser', 'user')
.where('chat_room.id = :roomId', { roomId: roomId })
.andWhere('chat_info.id < :chatId', { chatId: chatId })
.orderBy('chat_info.id', 'DESC')
.limit(30)
.getOne();
}*/

async getRoomAndChatInfo(roomId: number, userId: string) {
return await this.chatRoomRepository.findOne({
where: {
id: roomId,
},
relations: ['chats', 'userUser', 'writerUser'],
});
/*return await this.chatRoomRepository
.createQueryBuilder('chat_room')
.innerJoinAndSelect('chat_room.chats', 'chat_info')
.innerJoinAndSelect('chat_room.writerUser', 'writer')
.innerJoinAndSelect('chat_room.userUser', 'user')
.where('chat_room.id = :roomId', { roomId: roomId })
.andWhere('chat_info.id < 450374')
.limit(5)
.getOne();*/
}

async findRoomById(roomId: number, userId: string) {
Expand Down

0 comments on commit c10de5a

Please sign in to comment.