Store domain for DNS deployments after previous deployment is deleted

This commit is contained in:
IshaVenikar
2025-02-03 09:23:03 +05:30
parent 90e9260eb6
commit d0302d0153
2 changed files with 10 additions and 6 deletions
+1 -2
View File
@@ -387,8 +387,7 @@ export class Registry {
return records.filter((record: AppDeploymentRecord) =>
deployments.some(
(deployment) =>
deployment.applicationDeploymentRequestId === record.attributes.request &&
record.attributes.url.includes(deployment.id)
deployment.applicationDeploymentRequestId === record.attributes.request
)
);
}
+9 -4
View File
@@ -231,6 +231,9 @@ export class Service {
if (oldDNSDeployment) {
await this.db.deleteDeploymentById(oldDNSDeployment.id);
if (oldDNSDeployment.domain) {
await this.db.updateDeploymentById(deployment.id, { domain: oldDNSDeployment.domain})
}
}
}
@@ -701,7 +704,6 @@ export class Service {
await this.db.updateDeploymentById(dnsDeployment.id, {
applicationDeploymentRequestId,
applicationDeploymentRequestData,
domainId: domain?.id ?? null
});
}
@@ -723,7 +725,6 @@ export class Service {
await this.db.updateDeploymentById(deployment.id, {
applicationDeploymentRequestId,
applicationDeploymentRequestData,
domainId: domain?.id ?? null
});
return deployment;
@@ -1230,7 +1231,11 @@ export class Service {
projectId: deployment.project.id,
deployer: deployment.deployer,
isDNS: true
}
},
relations: {
project: true,
deployer: true,
},
})
if (!dnsDeployment) {
@@ -1240,7 +1245,7 @@ export class Service {
}
await this.laconicRegistry.createApplicationDeploymentRemovalRequest({
deploymentId: dnsDeployment.id,
deploymentId: dnsDeployment.applicationDeploymentRecordId!,
deployerLrn: dnsDeployment.deployer.deployerLrn,
auctionId: dnsDeployment.project.auctionId,
payment: dnsDeployment.project.txHash