From 49900db0239f1243028ad3a85422b5dd821464e9 Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Fri, 10 May 2024 17:14:27 -0300 Subject: [PATCH] fix: Avoid null result on profiles without flags --- hrm-domain/hrm-core/profile/sql/profile-flags-sql.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hrm-domain/hrm-core/profile/sql/profile-flags-sql.ts b/hrm-domain/hrm-core/profile/sql/profile-flags-sql.ts index 1a435b1e1..11f79df28 100644 --- a/hrm-domain/hrm-core/profile/sql/profile-flags-sql.ts +++ b/hrm-domain/hrm-core/profile/sql/profile-flags-sql.ts @@ -73,7 +73,7 @@ export const getProfileFlagsByIdentifierSql = ` SELECT DISTINCT pf.* FROM "Identifiers" ids LEFT JOIN "ProfilesToIdentifiers" p2i ON p2i."identifierId" = ids.id AND p2i."accountSid" = ids."accountSid" LEFT JOIN "ProfilesToProfileFlags" p2f ON p2f."profileId" = p2i."profileId" AND p2f."accountSid" = p2i."accountSid" - LEFT JOIN "ProfileFlags" pf ON pf.id = p2f."profileFlagId" AND (pf."accountSid" = p2f."accountSid" OR pf."accountSid" IS NULL) + INNER JOIN "ProfileFlags" pf ON pf.id = p2f."profileFlagId" AND (pf."accountSid" = p2f."accountSid" OR pf."accountSid" IS NULL) WHERE ids."identifier" = $ AND ids."accountSid" = $ `;