diff --git a/redisinsight/ui/src/slices/browser/keys.ts b/redisinsight/ui/src/slices/browser/keys.ts index 8e97bea651..f2b830bfd3 100644 --- a/redisinsight/ui/src/slices/browser/keys.ts +++ b/redisinsight/ui/src/slices/browser/keys.ts @@ -430,15 +430,18 @@ export function fetchKeys(cursor: string, count: number, onSuccess?: () => void, const { search: match, filter: type } = state.browser.keys const { encoding } = state.app.info - const { data, status } = await apiService.get( + const { data, status } = await apiService.post( getUrl( state.connections.instances?.connectedInstance?.id ?? '', ApiEndpoints.KEYS ), { - params: { cursor, count, type, match: match || DEFAULT_SEARCH_MATCH, encoding }, + cursor, count, type, match: match || DEFAULT_SEARCH_MATCH, + }, + { + params: { encoding }, cancelToken: sourceKeysFetch.token, - } + }, ) sourceKeysFetch = null @@ -513,15 +516,18 @@ export function fetchMoreKeys(oldKeys: IKeyPropTypes[] = [], cursor: string, cou const state = stateInit() const { search: match, filter: type } = state.browser.keys const { encoding } = state.app.info - const { data, status } = await apiService.get( + const { data, status } = await apiService.post( getUrl( state.connections.instances?.connectedInstance?.id ?? '', ApiEndpoints.KEYS ), { - params: { cursor, count, type, match: match || DEFAULT_SEARCH_MATCH, encoding }, + cursor, count, type, match: match || DEFAULT_SEARCH_MATCH, + }, + { + params: { encoding }, cancelToken: sourceKeysFetch.token, - } + }, ) sourceKeysFetch = null diff --git a/redisinsight/ui/src/slices/tests/browser/keys.spec.ts b/redisinsight/ui/src/slices/tests/browser/keys.spec.ts index cade1f38b1..04a1f5f2b9 100644 --- a/redisinsight/ui/src/slices/tests/browser/keys.spec.ts +++ b/redisinsight/ui/src/slices/tests/browser/keys.spec.ts @@ -864,7 +864,7 @@ describe('keys slice', () => { status: 200, } - apiService.get = jest.fn().mockResolvedValue(responsePayload) + apiService.post = jest.fn().mockResolvedValue(responsePayload) // Act await store.dispatch(fetchKeys(0, 20)) @@ -891,7 +891,7 @@ describe('keys slice', () => { }, } - apiService.get = jest.fn().mockRejectedValue(responsePayload) + apiService.post = jest.fn().mockRejectedValue(responsePayload) // Act await store.dispatch(fetchKeys('0', 20)) @@ -942,7 +942,7 @@ describe('keys slice', () => { status: 200, } - apiService.get = jest.fn().mockResolvedValue(responsePayload) + apiService.post = jest.fn().mockResolvedValue(responsePayload) // Act await store.dispatch(fetchMoreKeys([], '0', 20)) @@ -965,7 +965,7 @@ describe('keys slice', () => { }, } - apiService.get = jest.fn().mockRejectedValue(responsePayload) + apiService.post = jest.fn().mockRejectedValue(responsePayload) // Act await store.dispatch(fetchMoreKeys('0', 20))