Skip to content

Commit f771cc6

Browse files
Fixes #213 data.data
1 parent 99b90bf commit f771cc6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ui/src/components/ApiAction.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ export default function ApiAction(props: Props) {
145145
// do nothing
146146
}
147147

148+
const wasDataWrapped = (data && data._lrd)
149+
148150
if (data && data._lrd && data._lrd.queries) {
149151
const sqlQueries = data._lrd.queries.map((query: any) => {
150152
return "Connection: "
@@ -174,12 +176,12 @@ export default function ApiAction(props: Props) {
174176
})
175177
}
176178
if (isJson) {
177-
if (data?.data) {
179+
if (wasDataWrapped && data?.data) {
178180
setResponseData(JSON.stringify(data?.data, null, 2))
179181
} else {
180182
setResponseData(JSON.stringify(data, null, 2))
181183
}
182-
184+
183185
} else {
184186
setResponseData(dataString)
185187
}

0 commit comments

Comments
 (0)