Skip to content

Commit 2252a9c

Browse files
authored
Blacklisted titles filtering fix (#2871)
1 parent 854450a commit 2252a9c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

services/libs/data-access-layer/src/old/apps/data_sink_worker/repo/memberAffiliation.repo.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ export default class MemberAffiliationRepository extends RepositoryBase<MemberAf
151151
): IWorkExperienceData[] {
152152
return experiences.filter(
153153
(row) =>
154-
row.title &&
155-
blacklistedTitles.some((t) => row.title.toLowerCase().includes(t.toLowerCase())),
154+
!row.title ||
155+
(row.title !== null &&
156+
row.title !== undefined &&
157+
!blacklistedTitles.some((t) => row.title.toLowerCase().includes(t.toLowerCase()))),
156158
)
157159
}
158160
}

services/libs/data-access-layer/src/old/apps/profiles_worker/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,10 @@ export async function prepareMemberAffiliationsUpdate(qx: QueryExecutor, memberI
225225

226226
memberOrganizations = memberOrganizations.filter(
227227
(row) =>
228-
row.title !== null &&
229-
row.title !== undefined &&
230-
!blacklistedTitles.some((t) => row.title.toLowerCase().includes(t.toLowerCase())),
228+
!row.title ||
229+
(row.title !== null &&
230+
row.title !== undefined &&
231+
!blacklistedTitles.some((t) => row.title.toLowerCase().includes(t.toLowerCase()))),
231232
)
232233

233234
// clean unknown dated work experiences if there is one marked as primary

0 commit comments

Comments
 (0)