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:
Mathis HERRIOT
2026-01-29 15:47:43 +01:00
parent f852835c59
commit 0972ed951f
4 changed files with 45 additions and 0 deletions

View File

@@ -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,