dobo 2.30.4 → 2.30.6
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/lib/factory/driver.js
CHANGED
|
@@ -65,7 +65,7 @@ async function driverFactory () {
|
|
|
65
65
|
item[this.idField.name] = item.id
|
|
66
66
|
newId = true
|
|
67
67
|
}
|
|
68
|
-
for (const prop of model.
|
|
68
|
+
for (const prop of model.getNonVirtualProperties()) {
|
|
69
69
|
if (item[prop.name] === 'null') item[prop.name] = null
|
|
70
70
|
if (!isSet(item[prop.name]) && !this.support.nullableField) {
|
|
71
71
|
switch (prop.type) {
|
|
@@ -26,7 +26,7 @@ async function sanitizeBody ({ body = {}, partial, strict, extFields = [], noDef
|
|
|
26
26
|
|
|
27
27
|
const omitted = []
|
|
28
28
|
const details = []
|
|
29
|
-
const properties = [...this.
|
|
29
|
+
const properties = [...this.getNonVirtualProperties(), ...extFields]
|
|
30
30
|
for (const prop of properties) {
|
|
31
31
|
try {
|
|
32
32
|
if (partial && !has(body, prop.name)) {
|
|
@@ -40,7 +40,8 @@ async function sanitizeRecord (record = {}, opts = {}) {
|
|
|
40
40
|
let value = ['object', 'array'].includes(prop.type) ? cloneDeep(newRecord[key]) : newRecord[key]
|
|
41
41
|
if (prop.values) {
|
|
42
42
|
const values = await this.buildPropValues(prop, opts)
|
|
43
|
-
value = (values.find(
|
|
43
|
+
if (isArray(value)) value = value.map(v => (values.find(opt => opt.value === v) ?? {}).text ?? v)
|
|
44
|
+
else value = (values.find(v => v.value === value) ?? {}).text ?? value
|
|
44
45
|
}
|
|
45
46
|
if (prop.format === false) newRecord._fmt[key] = value + ''
|
|
46
47
|
else if (isFunction(prop.format)) newRecord._fmt[key] = await prop.format.call(this, value, newRecord, opts)
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-06-24
|
|
4
|
+
|
|
5
|
+
- [2.30.5] Bug fix in ```model.sanitizeBody()```
|
|
6
|
+
- [2.30.5] Bug fix in ```model.sanitizeRecord()```
|
|
7
|
+
- [2.30.6] Bug fix in ```driver.sanitizeRecord()```
|
|
8
|
+
|
|
3
9
|
## 2026-06-16
|
|
4
10
|
|
|
5
11
|
- [2.30.4] Bug fix in ```model.sanitizeBody()```
|