feat: added project detail API

This commit is contained in:
2026-07-06 14:05:38 +03:30
parent 5715cbe9b1
commit 5964a9b20d
4 changed files with 51 additions and 2 deletions
@@ -21,4 +21,19 @@ export class ProjectRepository extends Repository<TMProject> {
.take(take ?? 10)
.getManyAndCount();
}
async getProjectDetail(projectId: string): Promise<TMProject | null> {
return this.createQueryBuilder('project')
.leftJoinAndSelect('project.taskPhases', 'taskPhase')
.leftJoinAndSelect('taskPhase.tasks', 'task')
.where('project.id = :projectId', {projectId})
.select([
"project.id",
"project.name",
"taskPhase.id",
"taskPhase.name",
"task.id",
"task.title"
]).getOne();
}
}