Skip to content

Commit 51c0758

Browse files
author
KIvanow
committed
RI-6231 - addressing feedback
1 parent 2d08a99 commit 51c0758

File tree

2 files changed

+7
-8
lines changed
  • redisinsight/ui/src

2 files changed

+7
-8
lines changed

redisinsight/ui/src/pages/browser/modules/key-details/components/rejson-details/rejson-details/RejsonDetails.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,9 @@ const RejsonDetails = (props: BaseProps) => {
3232

3333
const dispatch = useDispatch()
3434

35-
const handleFetchVisualisationResults = (path: string, forceRetrieve = false) => new Promise((resolve, reject) => {
35+
const handleFetchVisualisationResults = (path: string, forceRetrieve = false) =>
3636
dispatch<any>(fetchVisualisationResults(path, forceRetrieve))
37-
.then((data: any) => resolve({
38-
...data,
39-
data: parseJsonData(data?.data)
40-
}))
41-
.catch(reject)
42-
})
37+
4338

4439
const handleAppendRejsonArrayItemAction = (keyName: RedisResponseBuffer, path: string, data: string) => {
4540
dispatch(appendReJSONArrayItemAction(keyName, path, data, length))

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { refreshKeyInfoAction } from './keys'
2323
import { InitialStateRejson, RedisResponseBuffer } from '../interfaces'
2424
import { addErrorNotification, addMessageNotification } from '../app/notifications'
2525
import { AppDispatch, RootState } from '../store'
26+
import { parseJsonData } from 'uiSrc/pages/browser/modules/key-details/components/rejson-details/utils'
2627

2728
const JSON_LENGTH_TO_FORCE_RETRIEVE = 200
2829

@@ -352,7 +353,10 @@ export function fetchVisualisationResults(path = '.', forceRetrieve = false) {
352353
)
353354

354355
if (isStatusSuccessful(status)) {
355-
return data
356+
return {
357+
...data,
358+
data: parseJsonData(data?.data)
359+
}
356360
}
357361
throw new Error(data.toString())
358362
} catch (_err) {

0 commit comments

Comments
 (0)