fix the missing createdBy icon for Companies (#10307)
fixes the missing icons for createdBy chips on Companies Refference fo the bug detection : https://discord.com/channels/1130383047699738754/1341407800424927232/1341407800424927232 <img width="378" alt="Screenshot 2025-02-18 at 17 37 34" src="https://github.com/user-attachments/assets/8c35ebf4-b946-4674-9f56-290be7c20c4f" />
This commit is contained in:
@ -117,8 +117,19 @@ export class CreateCompanyAndContactService {
|
||||
domainName?.domainName && isWorkDomain(domainName.domainName),
|
||||
);
|
||||
|
||||
const workDomainNamesToCreateFormatted = workDomainNamesToCreate.map(
|
||||
(domainName) => ({
|
||||
...domainName,
|
||||
createdBySource: source,
|
||||
createdByWorkspaceMember: connectedAccount.accountOwner,
|
||||
createdByContext: {
|
||||
provider: connectedAccount.provider,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
const companiesObject = await this.createCompaniesService.createCompanies(
|
||||
workDomainNamesToCreate,
|
||||
workDomainNamesToCreateFormatted,
|
||||
workspaceId,
|
||||
transactionManager,
|
||||
);
|
||||
|
||||
@ -2,7 +2,10 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import axios, { AxiosInstance } from 'axios';
|
||||
import uniqBy from 'lodash.uniqby';
|
||||
import { TWENTY_COMPANIES_BASE_URL } from 'twenty-shared';
|
||||
import {
|
||||
ConnectedAccountProvider,
|
||||
TWENTY_COMPANIES_BASE_URL,
|
||||
} from 'twenty-shared';
|
||||
import { DeepPartial, EntityManager, ILike } from 'typeorm';
|
||||
|
||||
import { FieldActorSource } from 'src/engine/metadata-modules/field-metadata/composite-types/actor.composite-type';
|
||||
@ -18,6 +21,9 @@ type CompanyToCreate = {
|
||||
domainName: string | undefined;
|
||||
createdBySource: FieldActorSource;
|
||||
createdByWorkspaceMember?: WorkspaceMemberWorkspaceEntity | null;
|
||||
createdByContext: {
|
||||
provider: ConnectedAccountProvider;
|
||||
};
|
||||
};
|
||||
|
||||
@Injectable()
|
||||
@ -120,6 +126,9 @@ export class CreateCompanyService {
|
||||
source: company.createdBySource,
|
||||
workspaceMemberId: company.createdByWorkspaceMember?.id,
|
||||
name: createdByName,
|
||||
context: {
|
||||
provider: company.createdByContext.provider,
|
||||
},
|
||||
},
|
||||
address: {
|
||||
addressCity: city,
|
||||
|
||||
Reference in New Issue
Block a user