Fix check for old DNS deployment
This commit is contained in:
parent
fd38127cb5
commit
8322f877c0
@ -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 });
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user