Fixed result JSON parser
This commit is contained in:
@@ -5538,14 +5538,17 @@ const AngularWorkflow = (props) => {
|
|||||||
// FIXME: The latter replace doens't really work if ' is used in a string
|
// FIXME: The latter replace doens't really work if ' is used in a string
|
||||||
var showResult = data.result.trim()
|
var showResult = data.result.trim()
|
||||||
showResult = showResult.split(" None").join(" \"None\"")
|
showResult = showResult.split(" None").join(" \"None\"")
|
||||||
|
showResult = showResult.split(" False").join(" false")
|
||||||
|
showResult = showResult.split(" True").join(" true")
|
||||||
showResult = showResult.split("\'").join("\"")
|
showResult = showResult.split("\'").join("\"")
|
||||||
|
|
||||||
var jsonvalid = true
|
var jsonvalid = true
|
||||||
try {
|
try {
|
||||||
const tmp = String(JSON.parse(showResult))
|
const tmp = String(JSON.parse(showResult))
|
||||||
if (!tmp.includes("{") && !tmp.includes("[")) {
|
//if (!tmp.includes("{") && !tmp.includes("[")) {
|
||||||
jsonvalid = false
|
// console.log("IN HERE")
|
||||||
}
|
// jsonvalid = false
|
||||||
|
//}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
jsonvalid = false
|
jsonvalid = false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user