Migrate domainName field from text type to links type (#6410)

Closes #5759.
This commit is contained in:
Marie
2024-07-30 11:47:37 +02:00
committed by GitHub
parent fb0fd99a38
commit 8e35edad30
44 changed files with 888 additions and 217 deletions

View File

@ -0,0 +1,13 @@
import { isDefined } from 'class-validator';
// temporary, to remove once domainName has been fully migrated to Links type
export const getCompanyDomainName = (company: any) => {
if (!isDefined(company.domainName)) {
return company.domainName;
}
if (typeof company.domainName === 'string') {
return company.domainName;
} else {
return company.domainName.primaryLinkUrl;
}
};