Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions redisinsight/ui/src/slices/browser/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions redisinsight/ui/src/slices/tests/browser/keys.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>(fetchKeys(0, 20))
Expand All @@ -891,7 +891,7 @@ describe('keys slice', () => {
},
}

apiService.get = jest.fn().mockRejectedValue(responsePayload)
apiService.post = jest.fn().mockRejectedValue(responsePayload)

// Act
await store.dispatch<any>(fetchKeys('0', 20))
Expand Down Expand Up @@ -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<any>(fetchMoreKeys([], '0', 20))
Expand All @@ -965,7 +965,7 @@ describe('keys slice', () => {
},
}

apiService.get = jest.fn().mockRejectedValue(responsePayload)
apiService.post = jest.fn().mockRejectedValue(responsePayload)

// Act
await store.dispatch<any>(fetchMoreKeys('0', 20))
Expand Down