From 89e4fddaa04d6f13d7c0bb761c170b3516e32c56 Mon Sep 17 00:00:00 2001 From: Dora <103416234+doracretu3pillar@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:26:07 +0200 Subject: [PATCH] PMM-13259: Restores logs bug (#783) * API fix according to swagger * Send restoresId instead of artifactId * Test selectRestore and onLogClick * Removed console logs from RestoreHistory * Update id type for Restore interface --- .../components/RestoreHistory/RestoreHistory.service.ts | 4 ++-- .../backup/components/RestoreHistory/RestoreHistory.tsx | 2 +- .../backup/components/RestoreHistory/RestoreHistory.types.ts | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/app/percona/backup/components/RestoreHistory/RestoreHistory.service.ts b/public/app/percona/backup/components/RestoreHistory/RestoreHistory.service.ts index b923ae6cc40f4..6709ac328fb02 100644 --- a/public/app/percona/backup/components/RestoreHistory/RestoreHistory.service.ts +++ b/public/app/percona/backup/components/RestoreHistory/RestoreHistory.service.ts @@ -43,9 +43,9 @@ export const RestoreHistoryService = { }) ); }, - async getLogs(artefactId: string, offset: number, limit: number, cancelToken?: CancelToken): Promise { + async getLogs(restoresId: string, offset: number, limit: number, cancelToken?: CancelToken): Promise { const { logs = [], end } = await api.get( - `${BASE_URL}/${artefactId}/logs`, + `${BASE_URL}/restores/${restoresId}/logs`, false, { cancelToken, params: { offset, limit } } ); diff --git a/public/app/percona/backup/components/RestoreHistory/RestoreHistory.tsx b/public/app/percona/backup/components/RestoreHistory/RestoreHistory.tsx index 6bbe01f609a90..8abebab5c03d7 100644 --- a/public/app/percona/backup/components/RestoreHistory/RestoreHistory.tsx +++ b/public/app/percona/backup/components/RestoreHistory/RestoreHistory.tsx @@ -200,7 +200,7 @@ export const RestoreHistory: FC = () => { const getLogs = useCallback( async (startingChunk: number, offset: number, token?: CancelToken) => - RestoreHistoryService.getLogs(selectedRestore!.artifactId, startingChunk, offset, token), + RestoreHistoryService.getLogs(selectedRestore!.id, startingChunk, offset, token), [selectedRestore] ); diff --git a/public/app/percona/backup/components/RestoreHistory/RestoreHistory.types.ts b/public/app/percona/backup/components/RestoreHistory/RestoreHistory.types.ts index 4d978efb7538e..9fbd123399f40 100644 --- a/public/app/percona/backup/components/RestoreHistory/RestoreHistory.types.ts +++ b/public/app/percona/backup/components/RestoreHistory/RestoreHistory.types.ts @@ -14,6 +14,7 @@ export interface RestoreResponse { } export interface Restore extends Omit { + id: string; artifactId: string; started: number; finished: number | null;