Error modal logic tweak

Check type instead of key name to determine whether to render value as
JSON
This commit is contained in:
Alex Liebowitz 2016-10-22 04:35:47 -04:00 committed by Alex Work
parent 6e5684c18b
commit 78cb810204

View file

@ -105,7 +105,7 @@ var App = React.createClass({
alertError: function(error) {
var errorInfoList = [];
for (let key of Object.keys(error)) {
let val = key == 'params' ? JSON.stringify(error[key]) : error[key];
let val = typeof error[key] == 'string' ? error[key] : JSON.stringify(error[key]);
let label = this._error_key_labels[key];
errorInfoList.push(<li><strong>{label}</strong>: <code>{val}</code></li>);
}