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); return await this.createProjectsListView(organizationId, results.data);
} }
async getProjectCounts( async getProjectCounts(projectId: string): Promise<ProjectCountsResponse> {
organizationId: string,
projectId: string,
): Promise<ProjectCountsResponse> {
const r = await this.apiService.send( const r = await this.apiService.send(
"GET", "GET",
"/organizations/" + organizationId + "/projects/" + projectId + "/sm-counts", "/projects/" + projectId + "/sm-counts",
null, null,
true, true,
true, true,

View File

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

View File

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

View File

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