@itleanchatbot/shared-models-js-postgres 1.1.31 → 1.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/dialogNodes.js +18 -14
package/package.json
CHANGED
package/src/dialogNodes.js
CHANGED
|
@@ -95,23 +95,27 @@ const DialogNodesModel = (sequelize, Sequelize) => {
|
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
get(field) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
try {
|
|
99
|
+
let value = this.getDataValue(field)
|
|
100
|
+
value = JSON.parse(value)
|
|
101
|
+
if (value.length) {
|
|
102
|
+
return value.map(item => {
|
|
103
|
+
try {
|
|
104
|
+
if(typeof item === 'string') {
|
|
105
|
+
return JSON.parse(item)
|
|
106
|
+
} else {
|
|
107
|
+
return item
|
|
108
|
+
}
|
|
109
|
+
} catch (error) {
|
|
110
|
+
console.error(error)
|
|
106
111
|
return item
|
|
107
112
|
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
return value
|
|
116
|
+
} catch (error) {
|
|
117
|
+
return this.getDataValue(field)
|
|
113
118
|
}
|
|
114
|
-
return value
|
|
115
119
|
},
|
|
116
120
|
},
|
|
117
121
|
})
|