From 044e136056d40e88636adef6510b991e57a9845d Mon Sep 17 00:00:00 2001 From: Alex Karpov Date: Thu, 29 Aug 2024 11:48:08 +0300 Subject: [PATCH] NAS-130838: API Keys deletion is not working (#10573) --- src/app/interfaces/api/api-call-directory.interface.ts | 2 +- .../components/api-key-list/api-key-list.component.spec.ts | 2 +- .../api-keys/components/api-key-list/api-key-list.component.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/interfaces/api/api-call-directory.interface.ts b/src/app/interfaces/api/api-call-directory.interface.ts index 5761776ee6f..e43da961851 100644 --- a/src/app/interfaces/api/api-call-directory.interface.ts +++ b/src/app/interfaces/api/api-call-directory.interface.ts @@ -306,7 +306,7 @@ export interface ApiCallDirectory { // API Key 'api_key.create': { params: [CreateApiKeyRequest]; response: ApiKey }; - 'api_key.delete': { params: [id: string]; response: boolean }; + 'api_key.delete': { params: [id: number]; response: boolean }; 'api_key.query': { params: QueryParams; response: ApiKey[] }; 'api_key.update': { params: UpdateApiKeyRequest; response: ApiKey }; diff --git a/src/app/pages/api-keys/components/api-key-list/api-key-list.component.spec.ts b/src/app/pages/api-keys/components/api-key-list/api-key-list.component.spec.ts index af6f04c2b1e..51053f7173e 100644 --- a/src/app/pages/api-keys/components/api-key-list/api-key-list.component.spec.ts +++ b/src/app/pages/api-keys/components/api-key-list/api-key-list.component.spec.ts @@ -114,6 +114,6 @@ describe('ApiKeyListComponent', () => { message: 'Are you sure you want to delete the first-api-key API Key?', }); - expect(spectator.inject(WebSocketService).call).toHaveBeenCalledWith('api_key.delete', ['1']); + expect(spectator.inject(WebSocketService).call).toHaveBeenCalledWith('api_key.delete', [1]); }); }); diff --git a/src/app/pages/api-keys/components/api-key-list/api-key-list.component.ts b/src/app/pages/api-keys/components/api-key-list/api-key-list.component.ts index 22c7d0f073d..7aad3d1551e 100644 --- a/src/app/pages/api-keys/components/api-key-list/api-key-list.component.ts +++ b/src/app/pages/api-keys/components/api-key-list/api-key-list.component.ts @@ -151,7 +151,7 @@ export class ApiKeyListComponent implements OnInit { }).pipe( filter(Boolean), tap(() => this.loader.open()), - switchMap(() => this.ws.call('api_key.delete', [String(apiKey.id)])), + switchMap(() => this.ws.call('api_key.delete', [apiKey.id])), untilDestroyed(this), ).subscribe({ next: () => this.store.apiKeyDeleted(apiKey.id),