Update method to return single DNS record by ID
All checks were successful
Lint / lint (20.x) (pull_request) Successful in 4m38s

This commit is contained in:
IshaVenikar 2025-01-31 18:18:25 +05:30
parent 00b0cec964
commit 605124e785
2 changed files with 8 additions and 8 deletions

View File

@ -431,9 +431,9 @@ export class Registry {
} }
/** /**
* Fetch record by Id * Fetch deployment DNS record by Id
*/ */
async getRecordById(id: string): Promise<DNSRecord[]> { async getDNSRecordById(id: string): Promise<DNSRecord> {
return this.registry.getRecordsByIds([id]); return this.registry.getRecordsByIds([id]);
} }

View File

@ -201,14 +201,14 @@ export class Service {
log(`Project ${deployment.projectId} not found`); log(`Project ${deployment.projectId} not found`);
return; return;
} else { } else {
const dnsRecords = await this.laconicRegistry.getRecordById(record.attributes.dns); const dnsRecord = await this.laconicRegistry.getDNSRecordById(record.attributes.dns);
const dnsRecordData: DNSRecordAttributes = { const dnsRecordData: DNSRecordAttributes = {
name: dnsRecords[0].attributes.name, name: dnsRecord.attributes.name,
request: dnsRecords[0].attributes.request, request: dnsRecord.attributes.request,
resourceType: dnsRecords[0].attributes.resourceType, resourceType: dnsRecord.attributes.resourceType,
value: dnsRecords[0].attributes.value, value: dnsRecord.attributes.value,
version: dnsRecords[0].attributes.version, version: dnsRecord.attributes.version,
} }
deployment.applicationDeploymentRecordId = record.id; deployment.applicationDeploymentRecordId = record.id;