Skip to content

Commit

Permalink
Merge pull request #8413 from cpitman/http-result-json
Browse files Browse the repository at this point in the history
[Fix] Store Outgoing Integration Result as String in Mongo
  • Loading branch information
rodrigok authored Nov 7, 2017
2 parents 19a170f + 9a6194c commit 5bc2be7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ <h2>
<div class="input-line double-col">
<label>{{_ "Integration_Outgoing_WebHook_History_Error_Stacktrace"}}</label>
<div>
<pre><code class="code-colors hljs json">{{{ hljsStack history.errorStack }}}</code></pre>
<pre><code class="code-colors hljs json">{{{ jsonStringify history.errorStack }}}</code></pre>
</div>
</div>
{{/if}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,12 @@ Template.integrationsOutgoingHistory.helpers({
},

jsonStringify(data) {
return data ? hljs.highlight('json', JSON.stringify(data, null, 2)).value : '';
},

hljsStack(errorStack) {
if (!errorStack) {
if (!data) {
return '';
} else if (typeof errorStack === 'object') {
return hljs.highlight('json', JSON.stringify(errorStack, null, 2)).value;
} else if (typeof data === 'object') {
return hljs.highlight('json', JSON.stringify(data, null, 2)).value;
} else {
return hljs.highlight('json', errorStack).value;
return hljs.highlight('json', data).value;
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ RocketChat.integrations.triggerHandler = new class RocketChatIntegrationHandler
}

if (typeof httpResult !== 'undefined') {
history.httpResult = httpResult;
history.httpResult = JSON.stringify(httpResult, null, 2);
}

if (typeof error !== 'undefined') {
Expand Down

0 comments on commit 5bc2be7

Please sign in to comment.