feat: add getProjectInfo method and corresponding endpoint in ProjectController; refactor logger methods to include projectId

This commit is contained in:
lborv
2025-10-28 20:36:53 +02:00
parent bbc378dc95
commit 84c48dd482
5 changed files with 49 additions and 14 deletions

View File

@ -65,4 +65,9 @@ export class ProjectController {
getAllApiTokens(@Req() req: Request & { apiToken: { id: string } }) {
return this.projectService.getAllApiTokens(req.apiToken.id);
}
@Get("info")
getProjectInfo(@Req() req: Request & { apiToken: { id: string } }) {
return this.projectService.getProjectInfo(req.apiToken.id);
}
}

View File

@ -84,4 +84,13 @@ export class ProjectService {
});
return project?.apiTokens || [];
}
async getProjectInfo(projectId: string) {
const project = await this.projectRepository.findOne({
where: { id: projectId },
relations: ["queries", "apiTokens", "functions", "settings"],
});
return project;
}
}