🐛 fix user projection

This commit is contained in:
Flam3rboy committed 2021-10-05 19:52:42 +02:00
1 parent 72299d722b
commit c3551d9254
7 files changed
+13 -6

No files matched your search

+1 -1
View File
@@ -203,7 +203,7 @@ 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);
const otherRecipientsUsers = await User.find({ where: recipients.map((x) => ({ id: x })) });
const otherRecipientsUsers = await User.find({ where: recipients.map((x) => ({ id: x })), select: ["id"] });
// TODO: check config for max number of recipients
if (otherRecipientsUsers.length !== recipients.length) {
+1
View File
@@ -29,6 +29,7 @@ export enum PrivateUserEnum {
premium,
premium_type,
disabled,
settings,
// locale
}
export type PrivateUserKeys = keyof typeof PrivateUserEnum | PublicUserKeys;