Skip to content

Commit b84a03f

Browse files
karthikvt26shahidhk
authored andcommitted
fix issue with pending event trigger logs when opened (hasura#926)
1 parent a1febad commit b84a03f

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

console/src/components/Services/EventTrigger/PendingEvents/ViewRows.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,10 @@ const ViewRows = ({
322322
null,
323323
4
324324
);
325-
const finalResponse = JSON.parse(
326-
JSON.stringify(finalRow.response, null, 4)
325+
const finalResponse = JSON.stringify(
326+
finalRow.response,
327+
null,
328+
4
327329
);
328330
return (
329331
<div style={{ padding: '20px' }}>

console/src/components/Services/EventTrigger/TableCommon/RedeliverEvent.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ class RedeliverEvent extends Component {
144144
finalResponse = JSON.stringify(finalResponse, null, 4);
145145
} catch (e) {
146146
console.error(e);
147+
if (typeof finalResponse === 'object') {
148+
finalResponse = JSON.stringify(finalResponse, null, 4);
149+
}
147150
}
148151
return (
149152
<div style={{ padding: '20px' }}>
@@ -187,6 +190,9 @@ class RedeliverEvent extends Component {
187190
latestResponse = log.eventInvocations[0]
188191
? log.eventInvocations[0].response
189192
: '';
193+
if (typeof latestResponse === 'object') {
194+
latestResponse = JSON.stringify(latestResponse, null, 4);
195+
}
190196
}
191197

192198
return (
@@ -221,10 +227,10 @@ class RedeliverEvent extends Component {
221227
value={
222228
log.eventInvocations[0]
223229
? JSON.stringify(
224-
log.eventInvocations[0].request,
225-
null,
226-
4
227-
)
230+
log.eventInvocations[0].request,
231+
null,
232+
4
233+
)
228234
: ''
229235
}
230236
minLines={8}

0 commit comments

Comments
 (0)