diff options
Diffstat (limited to 'src/util/entities/Member.ts')
-rw-r--r-- | src/util/entities/Member.ts | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/util/entities/Member.ts b/src/util/entities/Member.ts index cc2bf2a1..8c208202 100644 --- a/src/util/entities/Member.ts +++ b/src/util/entities/Member.ts @@ -330,17 +330,25 @@ export class Member extends BaseClassWithoutId { }); const memberCount = await Member.count({ where: { guild_id } }); - const memberPreview = await Member.find({ - where: { - guild_id, - user: { - sessions: { - status: Not("invisible" as const), // lol typescript? + + const memberPreview = ( + await Member.find({ + where: { + guild_id, + user: { + sessions: { + status: Not("invisible" as const), // lol typescript? + }, }, }, - }, - take: 10, - }); + relations: ["user", "roles"], + take: 10, + }) + ).map((member) => ({ + ...member.toPublicMember(), + user: member.user.toPublicUser(), + roles: member.roles.map((x) => x.id), + })); if ( await Member.count({ |