🐛 fix user projection

This commit is contained in:
Flam3rboy
2021-10-05 19:52:42 +02:00
parent b76961657e
commit ce63639090
7 changed files with 13 additions and 6 deletions
+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;