ja sdeljal #15

Merged
jana merged 1 commits from api_token into develop 2025-10-14 17:20:48 +00:00
2 changed files with 16 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -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 || [];
}
}