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:
bosiraphael
2024-02-19 18:46:49 +01:00
committed by GitHub
parent e34e341ddc
commit 09783912f3
5 changed files with 32 additions and 35 deletions

View File

@ -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,
);