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

@@ -29,6 +29,11 @@ export const MessageService = {
return data;
},
async getUnreadCount(): Promise<number> {
const { data } = await api.get<number>("/messages/unread-count");
return data;
},
async getMessages(conversationId: string): Promise<Message[]> {
const { data } = await api.get<Message[]>(
`/messages/conversations/${conversationId}`,