Skip to content

Commit ef3baf7

Browse files
committed
Organizations keeping existing website on integration updates (#1760)
1 parent e2c6c1c commit ef3baf7

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

services/apps/data_sink_worker/src/service/organization.service.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,13 @@ export class OrganizationService extends LoggerBase {
188188
'weakIdentities',
189189
]
190190
fields.forEach((field) => {
191-
if (cached[field] && !isEqual(cached[field], existing[field])) {
191+
if (field === 'website' && !existing.website) {
192+
updateData[field] = cached[field]
193+
} else if (
194+
field !== 'website' &&
195+
cached[field] &&
196+
!isEqual(cached[field], existing[field])
197+
) {
192198
updateData[field] = cached[field]
193199
}
194200
})
@@ -235,6 +241,15 @@ export class OrganizationService extends LoggerBase {
235241

236242
const identities = await txRepo.getIdentities(id, tenantId)
237243

244+
// create identities with incoming website
245+
if (data.website) {
246+
data.identities.push({
247+
name: websiteNormalizer(data.website),
248+
platform: 'email',
249+
integrationId,
250+
})
251+
}
252+
238253
for (const identity of data.identities) {
239254
const identityExists = identities.find(
240255
(i) => i.name === identity.name && i.platform === identity.platform,

0 commit comments

Comments
 (0)