From f65f2676d2a81246f00d0fcfb10f373627162c85 Mon Sep 17 00:00:00 2001 From: Suman991 Date: Fri, 17 Apr 2026 14:21:45 +0530 Subject: [PATCH] modified response schema --- src/conversations/conversations.service.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/conversations/conversations.service.ts b/src/conversations/conversations.service.ts index 5600679..0171681 100644 --- a/src/conversations/conversations.service.ts +++ b/src/conversations/conversations.service.ts @@ -50,7 +50,7 @@ export class ConversationsService { async addParticipant( convId: string, userId: string, - ): Promise { + ): Promise { const conv = await this.conversationModel.findById(convId); if (!conv) { throw new NotFoundException('Conversation not found'); @@ -66,13 +66,13 @@ export class ConversationsService { $addToSet: { participants: userId }, // prevent duplicate addition }, { new: true }, - ); + ).populate<{ participants: UserDocument[] }>('participants', 'name'); } async removeParticipant( conversationId: string, userId: string, - ): Promise { + ): Promise { const convo = await this.conversationModel.findById(conversationId); if (!convo) throw new NotFoundException('Conversation not found'); @@ -87,6 +87,6 @@ export class ConversationsService { $pull: { participants: userId }, }, { new: true }, - ); + ).populate<{ participants: UserDocument[] }>('participants', 'name');; } }