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:
@@ -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}`,
|
||||
|
||||
Reference in New Issue
Block a user