Fix check for old DNS deployment

This commit is contained in:
IshaVenikar 2025-02-03 15:40:05 +05:30
parent fd38127cb5
commit 8322f877c0

View File

@ -253,14 +253,14 @@ export class Service {
}
await this.db.deleteDeploymentById(oldDNSDeployment.id);
}
// Update domain after the previous DNS deployment is deleted due to unique key constraint for domain
// Set the domain for the new current DNS deployment to the custom domain that was added for that project
const domain = await this.db.getOldestDomainByProjectId(deployment.project.id);
const customDomain = await this.db.getOldestDomainByProjectId(deployment.project.id);
if (domain) {
await this.db.updateDeploymentById(deployment.id, { domain });
}
if (customDomain) {
await this.db.updateDeploymentById(deployment.id, { domain: customDomain });
}
}