Update flow for deleting deployments
All checks were successful
Lint / lint (20.x) (pull_request) Successful in 4m35s

This commit is contained in:
IshaVenikar 2025-02-03 17:49:06 +05:30
parent b50efe315b
commit b409d43e51

View File

@ -716,7 +716,7 @@ export class Service {
const environmentVariablesObj = await this.getEnvVariables(data.project!.id!);
// If a custom domain is present then use that as the DNS in the deployment request
const domain = await this.db.getOldestDomainByProjectId(data.project!.id!);
const customDomain = await this.db.getOldestDomainByProjectId(data.project!.id!);
// To set project DNS
if (data.environment === Environment.Production) {
@ -728,7 +728,7 @@ export class Service {
appName: repo,
repository: repoUrl,
environmentVariables: environmentVariablesObj,
dns: domain?.name ?? `${dnsDeployment.project.name}`,
dns: customDomain?.name ?? `${dnsDeployment.project.name}`,
lrn: deployer!.deployerLrn!,
apiUrl: deployer!.deployerApiUrl!,
payment: data.project.txHash,
@ -1280,11 +1280,20 @@ export class Service {
return false;
}
await this.laconicRegistry.createApplicationDeploymentRemovalRequest({
deploymentId: dnsDeployment.applicationDeploymentRecordId!,
deployerLrn: dnsDeployment.deployer.deployerLrn,
auctionId: dnsDeployment.project.auctionId,
payment: dnsDeployment.project.txHash
const dnsResult =
await this.laconicRegistry.createApplicationDeploymentRemovalRequest({
deploymentId: dnsDeployment.applicationDeploymentRecordId!,
deployerLrn: dnsDeployment.deployer.deployerLrn,
auctionId: dnsDeployment.project.auctionId,
payment: dnsDeployment.project.txHash
});
await this.db.updateDeploymentById(dnsDeployment.id, {
status: DeploymentStatus.Deleting,
applicationDeploymentRemovalRequestId:
dnsResult.applicationDeploymentRemovalRequestId,
applicationDeploymentRemovalRequestData:
dnsResult.applicationDeploymentRemovalRequestData,
});
}