feat: add API for fetching direct conversation with a user
- Added `GET /messages/conversations/with/:userId` endpoint in the backend to retrieve direct conversation data. - Implemented corresponding method in `MessagesService` and `MessagesRepository`. - Updated the frontend service to support fetching direct conversations via API.
This commit is contained in:
@@ -36,6 +36,13 @@ export const MessageService = {
|
||||
return data;
|
||||
},
|
||||
|
||||
async getConversationWith(userId: string): Promise<Conversation | null> {
|
||||
const { data } = await api.get<Conversation | null>(
|
||||
`/messages/conversations/with/${userId}`,
|
||||
);
|
||||
return data;
|
||||
},
|
||||
|
||||
async sendMessage(recipientId: string, text: string): Promise<Message> {
|
||||
const { data } = await api.post<Message>("/messages", {
|
||||
recipientId,
|
||||
|
||||
Reference in New Issue
Block a user