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:
@@ -22,6 +22,17 @@ export class MessagesController {
|
||||
return this.messagesService.getConversations(req.user.sub);
|
||||
}
|
||||
|
||||
@Get("conversations/with/:userId")
|
||||
getConversationWithUser(
|
||||
@Req() req: AuthenticatedRequest,
|
||||
@Param("userId") targetUserId: string,
|
||||
) {
|
||||
return this.messagesService.getConversationWithUser(
|
||||
req.user.sub,
|
||||
targetUserId,
|
||||
);
|
||||
}
|
||||
|
||||
@Get("conversations/:id")
|
||||
getMessages(
|
||||
@Req() req: AuthenticatedRequest,
|
||||
|
||||
Reference in New Issue
Block a user