Update methods for using stored DNS deployments in UI
This commit is contained in:
parent
2ee65b8fd8
commit
fc62392c83
@ -158,7 +158,7 @@ export class Database {
|
||||
.leftJoinAndSelect(
|
||||
'project.deployments',
|
||||
'deployments',
|
||||
'deployments.isCurrent = true'
|
||||
'deployments.isCurrent = true AND deployments.isDNS = true'
|
||||
)
|
||||
.leftJoinAndSelect('deployments.createdBy', 'user')
|
||||
.leftJoinAndSelect('deployments.domain', 'domain')
|
||||
@ -203,7 +203,7 @@ export class Database {
|
||||
.leftJoinAndSelect(
|
||||
'project.deployments',
|
||||
'deployments',
|
||||
'deployments.isCurrent = true'
|
||||
'deployments.isCurrent = true AND deployments.isDNS = true'
|
||||
)
|
||||
.leftJoinAndSelect('deployments.domain', 'domain')
|
||||
.leftJoin('project.projectMembers', 'projectMembers')
|
||||
@ -251,6 +251,26 @@ export class Database {
|
||||
});
|
||||
}
|
||||
|
||||
async getCommitDeploymentsByProjectId(projectId: string): Promise<Deployment[]> {
|
||||
return this.getDeployments({
|
||||
relations: {
|
||||
project: true,
|
||||
domain: true,
|
||||
createdBy: true,
|
||||
deployer: true,
|
||||
},
|
||||
where: {
|
||||
project: {
|
||||
id: projectId
|
||||
},
|
||||
isDNS: false
|
||||
},
|
||||
order: {
|
||||
createdAt: 'DESC'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async getDeployment(
|
||||
options: FindOneOptions<Deployment>
|
||||
): Promise<Deployment | null> {
|
||||
@ -632,7 +652,8 @@ export class Database {
|
||||
project: {
|
||||
id: projectId,
|
||||
},
|
||||
status: DeploymentStatus.Ready
|
||||
status: DeploymentStatus.Ready,
|
||||
isDNS: true
|
||||
}, order: {
|
||||
createdAt: "DESC",
|
||||
},
|
||||
|
@ -457,7 +457,7 @@ export class Service {
|
||||
}
|
||||
|
||||
async getDeploymentsByProjectId(projectId: string): Promise<Deployment[]> {
|
||||
const dbDeployments = await this.db.getDeploymentsByProjectId(projectId);
|
||||
const dbDeployments = await this.db.getCommitDeploymentsByProjectId(projectId);
|
||||
return dbDeployments;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user