Skip to content

Commit d34672a

Browse files
committed
refactor: update comment for database operation in mergeRoles func
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
1 parent 1322561 commit d34672a

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

services/libs/data-access-layer/src/members/organizations.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,18 +1152,15 @@ export async function mergeRoles(
11521152
finalAllowAffiliation = false
11531153
}
11541154

1155-
// 4. Update Database
1155+
// 4. Update db
11561156
const needsUpdate =
11571157
isTargetBlocked ||
11581158
primaryOverride?.allowAffiliation === false ||
11591159
secondaryManualBlock ||
11601160
finalIsPrimaryWorkExp
11611161

11621162
if (needsUpdate) {
1163-
// For duplicate roles (upsert), undefined allowAffiliation won't clear a stale false
1164-
// due to COALESCE in the ON CONFLICT clause. Explicitly set true when not blocked.
1165-
const effectiveAllowAffiliation =
1166-
finalAllowAffiliation === false ? false : !newRoleId ? true : finalAllowAffiliation
1163+
const effectiveAllowAffiliation = finalAllowAffiliation
11671164

11681165
await changeMemberOrganizationAffiliationOverrides(qx, [
11691166
{

0 commit comments

Comments
 (0)