Skip to content

Commit ced2844

Browse files
authored
Organization finding cache - also checking by name sent in payload (#1792)
1 parent 9a3438b commit ced2844

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/src/services/organizationService.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,10 @@ export default class OrganizationService extends LoggerBase {
353353
const shouldDoEnrich = await this.shouldEnrich(enrichP)
354354

355355
const primaryIdentity = data.identities[0]
356+
const nameToCheckInCache = (data as any).name || primaryIdentity.name
356357

357358
// check cache existing by name
358-
let cache = await organizationCacheRepository.findByName(primaryIdentity.name, {
359+
let cache = await organizationCacheRepository.findByName(nameToCheckInCache, {
359360
...this.options,
360361
transaction,
361362
})

0 commit comments

Comments
 (0)