remove unused joins
This commit is contained in:
@@ -23,17 +23,6 @@ export class ProjectRepository extends Repository<TMProject> {
|
||||
async getProjectDetail(projectId: string): Promise<TMProject | null> {
|
||||
return this.createQueryBuilder("project")
|
||||
.leftJoinAndSelect("project.taskPhases", "taskPhase")
|
||||
.leftJoinAndSelect("taskPhase.tasks", "task")
|
||||
.leftJoinAndSelect("task.remarks", "remark")
|
||||
|
||||
.loadRelationCountAndMap("task.attachmentCount", "task.attachments")
|
||||
|
||||
.loadRelationCountAndMap("task.checkListItemCount", "task.checkListItems")
|
||||
|
||||
.loadRelationCountAndMap("task.completedCheckListItemCount", "task.checkListItems", "completedCheckListItems", (qb) =>
|
||||
qb.where("completedCheckListItems.isDone = :isDone", { isDone: true }),
|
||||
)
|
||||
|
||||
.where("project.id = :projectId", { projectId })
|
||||
|
||||
.select([
|
||||
@@ -42,13 +31,6 @@ export class ProjectRepository extends Repository<TMProject> {
|
||||
"taskPhase.id",
|
||||
"taskPhase.name",
|
||||
"taskPhase.order",
|
||||
"task.id",
|
||||
"task.title",
|
||||
"task.startDate",
|
||||
"task.endDate",
|
||||
"task.color",
|
||||
"remark.title",
|
||||
"remark.color",
|
||||
])
|
||||
|
||||
.orderBy("taskPhase.order", "ASC")
|
||||
|
||||
Reference in New Issue
Block a user