From 69127d59f465510ae60364744d91e37b9805006f Mon Sep 17 00:00:00 2001 From: static Date: Tue, 5 Nov 2024 23:51:21 +0900 Subject: [PATCH] Add: withdraw field in room/report related responses --- src/modules/populates/reports.js | 2 +- src/modules/populates/rooms.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/populates/reports.js b/src/modules/populates/reports.js index 9f5b3fa4..baa7b4ee 100644 --- a/src/modules/populates/reports.js +++ b/src/modules/populates/reports.js @@ -1,7 +1,7 @@ const reportPopulateOption = [ { path: "reportedId", - select: "_id id name nickname profileImageUrl", + select: "_id id name nickname profileImageUrl withdraw", }, ]; diff --git a/src/modules/populates/rooms.js b/src/modules/populates/rooms.js index 5b8866be..a538a47f 100644 --- a/src/modules/populates/rooms.js +++ b/src/modules/populates/rooms.js @@ -10,7 +10,7 @@ const roomPopulateOption = [ select: "-_id user settlementStatus readAt", populate: { path: "user", - select: "_id id name nickname profileImageUrl", + select: "_id id name nickname profileImageUrl withdraw", }, }, ]; @@ -32,7 +32,7 @@ const formatSettlement = ( roomObject.part = roomObject.part.map((participantSubDocument) => { if (!participantSubDocument.user) return null; - const { _id, name, nickname, profileImageUrl } = + const { _id, name, nickname, profileImageUrl, withdraw } = participantSubDocument.user; const { settlementStatus, readAt } = participantSubDocument; return { @@ -40,6 +40,7 @@ const formatSettlement = ( name, nickname, profileImageUrl, + withdraw, isSettlement: includeSettlement ? settlementStatus : undefined, readAt: readAt ?? roomObject.madeat, };