remove unused joins

This commit is contained in:
2026-07-14 15:07:53 +03:30
parent 008bddb97a
commit f35df6492c
2 changed files with 75 additions and 18 deletions
@@ -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")