4008 dont create a contact company if it matches the persons domain (#4057)
* Add SettingsAccountsEmailsBlocklistInput story * prevent contact creation from the same company * add todo * improvements * Delete packages/twenty-front/src/modules/settings/accounts/components/__stories__/SettingsAccountsEmailsBlocklistInput.stories.tsx * refactor * modify after review * improve code
This commit is contained in:
@ -32,11 +32,12 @@ export class CreateCompaniesAndContactsAfterSyncJob
|
||||
);
|
||||
const { workspaceId, messageChannelId } = data;
|
||||
|
||||
const isContactAutoCreationEnabled =
|
||||
await this.messageChannelService.getIsContactAutoCreationEnabledByMessageChannelId(
|
||||
messageChannelId,
|
||||
workspaceId,
|
||||
);
|
||||
const messageChannel = await this.messageChannelService.getByIds(
|
||||
[messageChannelId],
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
const { handle, isContactAutoCreationEnabled } = messageChannel[0];
|
||||
|
||||
if (!isContactAutoCreationEnabled) {
|
||||
return;
|
||||
@ -49,6 +50,7 @@ export class CreateCompaniesAndContactsAfterSyncJob
|
||||
);
|
||||
|
||||
await this.createCompaniesAndContactsService.createCompaniesAndContacts(
|
||||
handle,
|
||||
messageParticipantsWithoutPersonIdAndWorkspaceMemberId,
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user