feat: add getProjectInfo method and corresponding endpoint in ProjectController; refactor logger methods to include projectId
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user