feat: add getProjectDetails method and corresponding endpoint

This commit is contained in:
lborv
2025-10-15 19:52:36 +03:00
parent 2671665e25
commit 6992041429
2 changed files with 30 additions and 1 deletions

View File

@ -27,6 +27,19 @@ export class ProjectService {
return projectSaved;
}
async getProjectDetails(projectId: string) {
const project = await this.projectRepository.findOne({
where: { id: projectId },
relations: ["database", "database.migrations", "queries", "functions"],
});
return {
migrations: project?.database?.migrations || [],
queries: project?.queries || [],
functions: project?.functions || [],
};
}
async findById(id: string) {
const cached = await this.redisClient.get(`project_${id}`);