From 3886c179c5dc4429aaef0c43d44742dbc57b6f68 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 23 Feb 2026 20:24:22 -0500 Subject: [PATCH] Remove default user scope on `GroupUser` (#11531) * Remove default user scope on GroupUser * revert --- server/models/GroupUser.ts | 8 -------- server/routes/api/groups/groups.ts | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/server/models/GroupUser.ts b/server/models/GroupUser.ts index ef983331a4..0749931a24 100644 --- a/server/models/GroupUser.ts +++ b/server/models/GroupUser.ts @@ -1,6 +1,5 @@ import type { InferAttributes, InferCreationAttributes } from "sequelize"; import { - DefaultScope, BelongsTo, ForeignKey, Column, @@ -14,13 +13,6 @@ import User from "./User"; import Model from "./base/Model"; import Fix from "./decorators/Fix"; -@DefaultScope(() => ({ - include: [ - { - association: "user", - }, - ], -})) @Scopes(() => ({ withGroup: { include: [ diff --git a/server/routes/api/groups/groups.ts b/server/routes/api/groups/groups.ts index 2a16921af7..07faa032cc 100644 --- a/server/routes/api/groups/groups.ts +++ b/server/routes/api/groups/groups.ts @@ -104,7 +104,7 @@ router.post( groupMemberships: ( await Promise.all( groups.map((group) => - GroupUser.findAll({ + GroupUser.scope("withUser").findAll({ where: { groupId: group.id, },