Skip to content

Commit

Permalink
PMM-13259: Restores logs bug (#783)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
doracretu3pillar authored Nov 11, 2024
1 parent 7d5c2e6 commit 89e4fdd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export const RestoreHistoryService = {
})
);
},
async getLogs(artefactId: string, offset: number, limit: number, cancelToken?: CancelToken): Promise<BackupLogs> {
async getLogs(restoresId: string, offset: number, limit: number, cancelToken?: CancelToken): Promise<BackupLogs> {
const { logs = [], end } = await api.get<BackupLogResponse, { offset: number; limit: number }>(
`${BASE_URL}/${artefactId}/logs`,
`${BASE_URL}/restores/${restoresId}/logs`,
false,
{ cancelToken, params: { offset, limit } }
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface RestoreResponse {
}

export interface Restore extends Omit<Backup, 'created' | 'status' | 'mode' | 'folder'> {
id: string;
artifactId: string;
started: number;
finished: number | null;
Expand Down

0 comments on commit 89e4fdd

Please sign in to comment.