Skip to content

Commit 49a182e

Browse files
committed
#RI-3650 - [FE] 431 status error on get big key
1 parent 546b577 commit 49a182e

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

redisinsight/ui/src/slices/browser/keys.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,15 +430,18 @@ export function fetchKeys(cursor: string, count: number, onSuccess?: () => void,
430430
const { search: match, filter: type } = state.browser.keys
431431
const { encoding } = state.app.info
432432

433-
const { data, status } = await apiService.get(
433+
const { data, status } = await apiService.post(
434434
getUrl(
435435
state.connections.instances?.connectedInstance?.id ?? '',
436436
ApiEndpoints.KEYS
437437
),
438438
{
439-
params: { cursor, count, type, match: match || DEFAULT_SEARCH_MATCH, encoding },
439+
cursor, count, type, match: match || DEFAULT_SEARCH_MATCH,
440+
},
441+
{
442+
params: { encoding },
440443
cancelToken: sourceKeysFetch.token,
441-
}
444+
},
442445
)
443446

444447
sourceKeysFetch = null
@@ -513,15 +516,18 @@ export function fetchMoreKeys(oldKeys: IKeyPropTypes[] = [], cursor: string, cou
513516
const state = stateInit()
514517
const { search: match, filter: type } = state.browser.keys
515518
const { encoding } = state.app.info
516-
const { data, status } = await apiService.get(
519+
const { data, status } = await apiService.post(
517520
getUrl(
518521
state.connections.instances?.connectedInstance?.id ?? '',
519522
ApiEndpoints.KEYS
520523
),
521524
{
522-
params: { cursor, count, type, match: match || DEFAULT_SEARCH_MATCH, encoding },
525+
cursor, count, type, match: match || DEFAULT_SEARCH_MATCH,
526+
},
527+
{
528+
params: { encoding },
523529
cancelToken: sourceKeysFetch.token,
524-
}
530+
},
525531
)
526532

527533
sourceKeysFetch = null

redisinsight/ui/src/slices/tests/browser/keys.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ describe('keys slice', () => {
864864
status: 200,
865865
}
866866

867-
apiService.get = jest.fn().mockResolvedValue(responsePayload)
867+
apiService.post = jest.fn().mockResolvedValue(responsePayload)
868868

869869
// Act
870870
await store.dispatch<any>(fetchKeys(0, 20))
@@ -891,7 +891,7 @@ describe('keys slice', () => {
891891
},
892892
}
893893

894-
apiService.get = jest.fn().mockRejectedValue(responsePayload)
894+
apiService.post = jest.fn().mockRejectedValue(responsePayload)
895895

896896
// Act
897897
await store.dispatch<any>(fetchKeys('0', 20))
@@ -942,7 +942,7 @@ describe('keys slice', () => {
942942
status: 200,
943943
}
944944

945-
apiService.get = jest.fn().mockResolvedValue(responsePayload)
945+
apiService.post = jest.fn().mockResolvedValue(responsePayload)
946946

947947
// Act
948948
await store.dispatch<any>(fetchMoreKeys([], '0', 20))
@@ -965,7 +965,7 @@ describe('keys slice', () => {
965965
},
966966
}
967967

968-
apiService.get = jest.fn().mockRejectedValue(responsePayload)
968+
apiService.post = jest.fn().mockRejectedValue(responsePayload)
969969

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

0 commit comments

Comments
 (0)