fix(domain-manager): correct domain URL reference and filter logic (#12074)

Updated URL reference from getFrontUrl to getBaseUrl to ensure correct
hostname handling. Adjusted record filtering logic to exclude successful
records, preventing unnecessary rendering in the UI.
This commit is contained in:
Antoine Moreaux
2025-05-15 19:35:55 +02:00
committed by GitHub
parent 09d92c9113
commit 1570ad955e
4 changed files with 41 additions and 37 deletions

View File

@ -36,7 +36,7 @@ describe('CustomDomainService', () => {
{
provide: DomainManagerService,
useValue: {
getFrontUrl: jest.fn(),
getBaseUrl: jest.fn(),
},
},
],
@ -148,7 +148,7 @@ describe('CustomDomainService', () => {
jest.spyOn(twentyConfigService, 'get').mockReturnValue('test-zone-id');
jest
.spyOn(domainManagerService, 'getFrontUrl')
.spyOn(domainManagerService, 'getBaseUrl')
.mockReturnValue(new URL('https://front.domain'));
(customDomainService as any).cloudflareClient = cloudflareMock;
@ -185,7 +185,7 @@ describe('CustomDomainService', () => {
jest.spyOn(twentyConfigService, 'get').mockReturnValue('test-zone-id');
jest
.spyOn(domainManagerService, 'getFrontUrl')
.spyOn(domainManagerService, 'getBaseUrl')
.mockReturnValue(new URL('https://front.domain'));
(customDomainService as any).cloudflareClient = cloudflareMock;

View File

@ -133,7 +133,7 @@ export class CustomDomainService {
? 'error'
: 'success',
key: response.result[0].hostname,
value: this.domainManagerService.getFrontUrl().hostname,
value: this.domainManagerService.getBaseUrl().hostname,
},
]),
};