summary refs log tree commit diff
path: root/src/util/dtos/DmChannelDTO.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-01-20 18:10:47 +1100
committerGitHub <noreply@github.com>2023-01-20 18:10:47 +1100
commit084dc0be08555891cad4c2bb984822a62ec5ec9f (patch)
treeed2ca0fafefa2224ae32761f955f63935422a97d /src/util/dtos/DmChannelDTO.ts
parentfix: route file regex (#956) (diff)
downloadserver-084dc0be08555891cad4c2bb984822a62ec5ec9f.tar.xz
Add ESLint (#941)
* Add eslint, switch to lint-staged for precommit

* Fix all ESLint errors

* Update GH workflow to check prettier and eslint
Diffstat (limited to 'src/util/dtos/DmChannelDTO.ts')
-rw-r--r--src/util/dtos/DmChannelDTO.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/util/dtos/DmChannelDTO.ts b/src/util/dtos/DmChannelDTO.ts

index 9d4d8dc3..02f7e8f3 100644 --- a/src/util/dtos/DmChannelDTO.ts +++ b/src/util/dtos/DmChannelDTO.ts
@@ -44,16 +44,14 @@ export class DmChannelDTO { obj.type = channel.type; obj.recipients = ( await Promise.all( - channel - .recipients!.filter( - (r) => !excluded_recipients.includes(r.user_id), - ) + channel.recipients + ?.filter((r) => !excluded_recipients.includes(r.user_id)) .map(async (r) => { return await User.findOneOrFail({ where: { id: r.user_id }, select: PublicUserProjection, }); - }), + }) || [], ) ).map((u) => new MinimalPublicUserDTO(u)); return obj;