Error modal logic tweak
Check type instead of key name to determine whether to render value as JSON
This commit is contained in:
parent
6e5684c18b
commit
78cb810204
1 changed files with 1 additions and 1 deletions
|
@ -105,7 +105,7 @@ var App = React.createClass({
|
||||||
alertError: function(error) {
|
alertError: function(error) {
|
||||||
var errorInfoList = [];
|
var errorInfoList = [];
|
||||||
for (let key of Object.keys(error)) {
|
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];
|
let label = this._error_key_labels[key];
|
||||||
errorInfoList.push(<li><strong>{label}</strong>: <code>{val}</code></li>);
|
errorInfoList.push(<li><strong>{label}</strong>: <code>{val}</code></li>);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue