summary refs log tree commit diff
path: root/src/util/dtos
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-26 22:29:30 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-26 22:41:21 +1000
commit99ee7e9400f06e8718612d8b52d15215dc620774 (patch)
tree08de8c5d3985b9c2eaa419f5198f891ecd82d012 /src/util/dtos
parentRemove the cdn storage location log (diff)
downloadserver-99ee7e9400f06e8718612d8b52d15215dc620774.tar.xz
Prettier
Diffstat (limited to 'src/util/dtos')
-rw-r--r--src/util/dtos/DmChannelDTO.ts21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/util/dtos/DmChannelDTO.ts b/src/util/dtos/DmChannelDTO.ts

index 226b2f9d..fcc91204 100644 --- a/src/util/dtos/DmChannelDTO.ts +++ b/src/util/dtos/DmChannelDTO.ts
@@ -11,7 +11,11 @@ export class DmChannelDTO { recipients: MinimalPublicUserDTO[]; type: number; - static async from(channel: Channel, excluded_recipients: string[] = [], origin_channel_id?: string) { + static async from( + channel: Channel, + excluded_recipients: string[] = [], + origin_channel_id?: string, + ) { const obj = new DmChannelDTO(); obj.icon = channel.icon || null; obj.id = channel.id; @@ -23,10 +27,15 @@ export class DmChannelDTO { obj.recipients = ( await Promise.all( channel - .recipients!.filter((r) => !excluded_recipients.includes(r.user_id)) + .recipients!.filter( + (r) => !excluded_recipients.includes(r.user_id), + ) .map(async (r) => { - return await User.findOneOrFail({ where: { id: r.user_id }, select: PublicUserProjection }); - }) + return await User.findOneOrFail({ + where: { id: r.user_id }, + select: PublicUserProjection, + }); + }), ) ).map((u) => new MinimalPublicUserDTO(u)); return obj; @@ -35,7 +44,9 @@ export class DmChannelDTO { excludedRecipients(excluded_recipients: string[]): DmChannelDTO { return { ...this, - recipients: this.recipients.filter((r) => !excluded_recipients.includes(r.id)), + recipients: this.recipients.filter( + (r) => !excluded_recipients.includes(r.id), + ), }; } }