summary refs log tree commit diff
path: root/src/util/entities/Channel.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-26 12:42:01 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-26 12:42:01 +1000
commitc3591a82334669b87499c6bed3cb6d697bdc1acc (patch)
tree7b476130155cc9a98a5143fed4533efc212080ad /src/util/entities/Channel.ts
parentRefactor to mono-repo + upgrade packages (diff)
downloadserver-c3591a82334669b87499c6bed3cb6d697bdc1acc.tar.xz
'Fix' distinct alias typeorm issue
Diffstat (limited to '')
-rw-r--r--src/util/entities/Channel.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/util/entities/Channel.ts b/src/util/entities/Channel.ts

index 577b627e..2200bfa3 100644 --- a/src/util/entities/Channel.ts +++ b/src/util/entities/Channel.ts
@@ -245,11 +245,10 @@ export class Channel extends BaseClass { static async createDMChannel(recipients: string[], creator_user_id: string, name?: string) { recipients = recipients.unique().filter((x) => x !== creator_user_id); - //@ts-ignore some typeorm typescript issue - const otherRecipientsUsers = await User.find({ where: recipients.map((x) => ({ id: x })) }); - // TODO: check config for max number of recipients /** if you want to disallow note to self channels, uncomment the conditional below + + const otherRecipientsUsers = await User.find({ where: recipients.map((x) => ({ id: x })) }); if (otherRecipientsUsers.length !== recipients.length) { throw new HTTPError("Recipient/s not found"); }