Rename method for getting commit deployments by Id
All checks were successful
Lint / lint (20.x) (pull_request) Successful in 4m36s

This commit is contained in:
IshaVenikar 2025-02-03 11:15:19 +05:30
parent 32001b3d5a
commit c685b7d5b1
2 changed files with 17 additions and 19 deletions

View File

@ -38,7 +38,7 @@ export const createResolvers = async (service: Service): Promise<any> => {
},
deployments: async (_: any, { projectId }: { projectId: string }) => {
return service.getDeploymentsByProjectId(projectId);
return service.getCommitDeploymentsByProjectId(projectId);
},
environmentVariables: async (

View File

@ -237,21 +237,19 @@ export class Service {
}
});
if (!oldDNSDeployment) {
return;
}
if (oldDNSDeployment) {
// Delete previous DNS deployment
await this.db.deleteDeploymentById(oldDNSDeployment.id);
// Delete previous DNS deployment
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 either the domain of the previous deployment if present
// Or to the custom domain that was added for that project
const domain = oldDNSDeployment.domain
|| await this.db.getOldestDomainByProjectId(deployment.project.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 either the domain of the previous deployment if present
// Or to the custom domain that was added for that project
const domain = oldDNSDeployment.domain
|| await this.db.getOldestDomainByProjectId(deployment.project.id);
if (domain) {
await this.db.updateDeploymentById(deployment.id, { domain });
if (domain) {
await this.db.updateDeploymentById(deployment.id, { domain });
}
}
}
@ -483,14 +481,14 @@ export class Service {
return dbProjects;
}
async getDeploymentsByProjectId(projectId: string): Promise<Deployment[]> {
const dbDeployments = await this.db.getCommitDeploymentsByProjectId(projectId);
return dbDeployments;
async getCommitDeploymentsByProjectId(projectId: string): Promise<Deployment[]> {
const commitDeployments = await this.db.getCommitDeploymentsByProjectId(projectId);
return commitDeployments;
}
async getLatestDNSDataByProjectId(projectId: string): Promise<DNSRecordAttributes | null> {
const dbDeployments = await this.db.getLatestDNSDataByProjectId(projectId);
return dbDeployments;
const dnsDeployments = await this.db.getLatestDNSDataByProjectId(projectId);
return dnsDeployments;
}
async getEnvironmentVariablesByProjectId(