Skip to content

Commit

Permalink
Add: withdraw field in room/report related responses
Browse files Browse the repository at this point in the history
  • Loading branch information
kmc7468 committed Nov 5, 2024
1 parent 826ee1a commit 69127d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/modules/populates/reports.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const reportPopulateOption = [
{
path: "reportedId",
select: "_id id name nickname profileImageUrl",
select: "_id id name nickname profileImageUrl withdraw",
},
];

Expand Down
5 changes: 3 additions & 2 deletions src/modules/populates/rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
];
Expand All @@ -32,14 +32,15 @@ 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 {
_id,
name,
nickname,
profileImageUrl,
withdraw,
isSettlement: includeSettlement ? settlementStatus : undefined,
readAt: readAt ?? roomObject.madeat,
};
Expand Down

0 comments on commit 69127d5

Please sign in to comment.