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(
|
.leftJoinAndSelect(
|
||||||
'project.deployments',
|
'project.deployments',
|
||||||
'deployments',
|
'deployments',
|
||||||
'deployments.isCurrent = true'
|
'deployments.isCurrent = true AND deployments.isDNS = true'
|
||||||
)
|
)
|
||||||
.leftJoinAndSelect('deployments.createdBy', 'user')
|
.leftJoinAndSelect('deployments.createdBy', 'user')
|
||||||
.leftJoinAndSelect('deployments.domain', 'domain')
|
.leftJoinAndSelect('deployments.domain', 'domain')
|
||||||
@ -203,7 +203,7 @@ export class Database {
|
|||||||
.leftJoinAndSelect(
|
.leftJoinAndSelect(
|
||||||
'project.deployments',
|
'project.deployments',
|
||||||
'deployments',
|
'deployments',
|
||||||
'deployments.isCurrent = true'
|
'deployments.isCurrent = true AND deployments.isDNS = true'
|
||||||
)
|
)
|
||||||
.leftJoinAndSelect('deployments.domain', 'domain')
|
.leftJoinAndSelect('deployments.domain', 'domain')
|
||||||
.leftJoin('project.projectMembers', 'projectMembers')
|
.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(
|
async getDeployment(
|
||||||
options: FindOneOptions<Deployment>
|
options: FindOneOptions<Deployment>
|
||||||
): Promise<Deployment | null> {
|
): Promise<Deployment | null> {
|
||||||
@ -632,7 +652,8 @@ export class Database {
|
|||||||
project: {
|
project: {
|
||||||
id: projectId,
|
id: projectId,
|
||||||
},
|
},
|
||||||
status: DeploymentStatus.Ready
|
status: DeploymentStatus.Ready,
|
||||||
|
isDNS: true
|
||||||
}, order: {
|
}, order: {
|
||||||
createdAt: "DESC",
|
createdAt: "DESC",
|
||||||
},
|
},
|
||||||
|
@ -457,7 +457,7 @@ export class Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDeploymentsByProjectId(projectId: string): Promise<Deployment[]> {
|
async getDeploymentsByProjectId(projectId: string): Promise<Deployment[]> {
|
||||||
const dbDeployments = await this.db.getDeploymentsByProjectId(projectId);
|
const dbDeployments = await this.db.getCommitDeploymentsByProjectId(projectId);
|
||||||
return dbDeployments;
|
return dbDeployments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user