feat: add unread message count API
- Added `GET /messages/unread-count` endpoint to retrieve the count of unread messages for a user. - Implemented `getUnreadCount` method in `MessagesService` and `MessagesRepository`. - Updated frontend service to support fetching unread message count via API.
This commit is contained in:
@@ -42,6 +42,10 @@ export class MessagesService {
|
||||
return this.messagesRepository.findAllConversations(userId);
|
||||
}
|
||||
|
||||
async getUnreadCount(userId: string) {
|
||||
return this.messagesRepository.countUnreadMessages(userId);
|
||||
}
|
||||
|
||||
async getConversationWithUser(userId: string, targetUserId: string) {
|
||||
return this.messagesRepository.findConversationBetweenUsers(
|
||||
userId,
|
||||
|
||||
Reference in New Issue
Block a user