From 7513f74203c03d4dfc1d128a3fe9ad5a163f2f2c Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Wed, 25 Sep 2024 14:40:06 +0200 Subject: [PATCH] feat: don't use left joins --- .../personal-dashboard-read-model.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/lib/features/personal-dashboard/personal-dashboard-read-model.ts b/src/lib/features/personal-dashboard/personal-dashboard-read-model.ts index 9225a96f5433..ce761f24e952 100644 --- a/src/lib/features/personal-dashboard/personal-dashboard-read-model.ts +++ b/src/lib/features/personal-dashboard/personal-dashboard-read-model.ts @@ -28,15 +28,11 @@ export class PersonalDashboardReadModel implements IPersonalDashboardReadModel { }>('projects') .join('role_user', 'projects.id', 'role_user.project') .join('roles', 'role_user.role_id', 'roles.id') - .leftJoin('group_user', (join) => { + .join('group_user', (join) => { join.on('group_user.user_id', '=', this.db.raw('?', [userId])); }) - .leftJoin( - 'group_role', - 'group_role.group_id', - 'group_user.group_id', - ) - .leftJoin( + .join('group_role', 'group_role.group_id', 'group_user.group_id') + .join( 'roles as group_roles', 'group_role.role_id', 'group_roles.id',