Merge pull request 'ja sdeljal' (#15) from api_token into develop
All checks were successful
Deploy to Testing Server / Deploy to Testing Environment (push) Successful in 23s
All checks were successful
Deploy to Testing Server / Deploy to Testing Environment (push) Successful in 23s
Reviewed-on: http://192.168.0.16:3000/lborv/few-line-engine/pulls/15 Reviewed-by: lborv <boris.djumajev@gmail.com>
This commit is contained in:
@ -58,4 +58,11 @@ export class ProjectController {
|
||||
getAllSettings(@Req() req: Request & { apiToken: { id: string } }) {
|
||||
return this.projectSettingService.getAll(req.apiToken.id);
|
||||
}
|
||||
}
|
||||
|
||||
@Get("api-tokens")
|
||||
@UseGuards(AdminGuard)
|
||||
getAllApiTokens(@Req() req: Request & { apiToken: { id: string } }) {
|
||||
return this.projectService.getAllApiTokens(req.apiToken.id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -76,4 +76,12 @@ export class ProjectService {
|
||||
redisNodes: redisNodeId,
|
||||
});
|
||||
}
|
||||
|
||||
async getAllApiTokens(projectId: string) {
|
||||
const project = await this.projectRepository.findOne({
|
||||
where: { id: projectId },
|
||||
relations: ["apiTokens"],
|
||||
});
|
||||
return project?.apiTokens || [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user