From a834184690f6b2343cd7f73bc51b87a0e3469a59 Mon Sep 17 00:00:00 2001 From: Rory& Date: Sat, 13 Dec 2025 02:10:23 +0100 Subject: [PATCH] Fix missing group by? --- src/util/entities/User.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/entities/User.ts b/src/util/entities/User.ts index 9ef531412..7b78b428a 100644 --- a/src/util/entities/User.ts +++ b/src/util/entities/User.ts @@ -345,6 +345,7 @@ export class User extends BaseClass { .where("Channel.type = :type", { type: ChannelType.DM }) .andWhere("rcp.user_id IN (:...user_ids)", { user_ids: [this.id, user_id] }) .groupBy("Channel.id") + .addGroupBy("rcp.user_id") .having("COUNT(rcp.user_id) = 2") .getMany(); @@ -367,6 +368,7 @@ export class User extends BaseClass { .where("Channel.type = :type", { type: ChannelType.DM }) .andWhere("rcp.user_id = :user_id", { user_id: this.id }) .groupBy("Channel.id") + .addGroupBy("rcp.user_id") .having("COUNT(rcp.user_id) = 2") .getMany();