SM-1146: Total counts API paths update

This commit is contained in:
Maciej Zieniuk 2024-06-26 11:55:36 +02:00
parent 8793cc0267
commit c725d53d1a
No known key found for this signature in database
GPG Key ID: 9CACE59F1272ACD9
4 changed files with 6 additions and 18 deletions

View File

@ -48,13 +48,10 @@ export class ProjectService {
return await this.createProjectsListView(organizationId, results.data);
}
async getProjectCounts(
organizationId: string,
projectId: string,
): Promise<ProjectCountsResponse> {
async getProjectCounts(projectId: string): Promise<ProjectCountsResponse> {
const r = await this.apiService.send(
"GET",
"/organizations/" + organizationId + "/projects/" + projectId + "/sm-counts",
"/projects/" + projectId + "/sm-counts",
null,
true,
true,

View File

@ -75,11 +75,7 @@ export class ProjectComponent implements OnInit, OnDestroy {
this.secretService.secret$.pipe(startWith(null)),
this.accessPolicyService.accessPolicy$.pipe(startWith(null)),
this.serviceAccountService.serviceAccount$.pipe(startWith(null)),
]).pipe(
switchMap(([params]) =>
this.projectService.getProjectCounts(params.organizationId, params.projectId),
),
);
]).pipe(switchMap(([params]) => this.projectService.getProjectCounts(params.projectId)));
combineLatest([projectId$, organization$, projectCounts$])
.pipe(takeUntil(this.destroy$))

View File

@ -57,9 +57,7 @@ export class ServiceAccountComponent implements OnInit, OnDestroy {
this.accessService.accessToken$.pipe(startWith(null)),
this.onChange$,
]).pipe(
switchMap(([params, _]) =>
this.serviceAccountService.getCounts(params.organizationId, params.serviceAccountId),
),
switchMap(([params, _]) => this.serviceAccountService.getCounts(params.serviceAccountId)),
);
combineLatest([this.serviceAccount$, serviceAccountCounts$])

View File

@ -71,13 +71,10 @@ export class ServiceAccountService {
return await this.createServiceAccountView(orgKey, new ServiceAccountResponse(r));
}
async getCounts(
organizationId: string,
serviceAccountId: string,
): Promise<ServiceAccountCountsResponse> {
async getCounts(serviceAccountId: string): Promise<ServiceAccountCountsResponse> {
const r = await this.apiService.send(
"GET",
"/organizations/" + organizationId + "/service-accounts/" + serviceAccountId + "/sm-counts",
"/service-accounts/" + serviceAccountId + "/sm-counts",
null,
true,
true,