oradm-to-gql 35.0.4 → 35.0.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/package.json
CHANGED
@@ -33,15 +33,23 @@ async function create{{makePlural(entityName)}}(createRecords, trx, opts){
|
|
33
33
|
|
34
34
|
if(!allowQuery) return Promise.resolve([]);
|
35
35
|
|
36
|
-
createRecords.forEach(rec => {
|
37
36
|
{% for propName, attrDef in table.attributes %}
|
38
37
|
{% if attrDef.dataType === 'Boolean' %}
|
39
|
-
|
40
|
-
delete rec.{{attrDef.name}}
|
41
|
-
}
|
38
|
+
{% set hasBool = "true" %}
|
42
39
|
{% endif %}
|
43
40
|
{% endfor %}
|
44
|
-
|
41
|
+
|
42
|
+
{% if hasBool === "true" %}
|
43
|
+
createRecords.forEach(rec => {
|
44
|
+
{% for propName, attrDef in table.attributes %}
|
45
|
+
{% if attrDef.dataType === 'Boolean' %}
|
46
|
+
if (rec.{{attrDef.name}} === null) {
|
47
|
+
delete rec.{{attrDef.name}}
|
48
|
+
}
|
49
|
+
{% endif %}
|
50
|
+
{% endfor %}
|
51
|
+
})
|
52
|
+
{% endif %}
|
45
53
|
|
46
54
|
let records = await Promise.resolve(this.entities.{{table.modelName}}.extensions.onCreate.records.call(this, createRecords, opts));
|
47
55
|
|
@@ -22,6 +22,13 @@ async function update{{makePlural(entityName)}}(updateRecords, fkFilter, trx, op
|
|
22
22
|
|
23
23
|
if(!allowQuery) return Promise.resolve([]);
|
24
24
|
|
25
|
+
{% for propName, attrDef in table.attributes %}
|
26
|
+
{% if attrDef.dataType === 'Boolean' %}
|
27
|
+
{% set hasBool = "true" %}
|
28
|
+
{% endif %}
|
29
|
+
{% endfor %}
|
30
|
+
|
31
|
+
{% if hasBool === "true" %}
|
25
32
|
updateRecords.forEach(rec => {
|
26
33
|
{% for propName, attrDef in table.attributes %}
|
27
34
|
{% if attrDef.dataType === 'Boolean' %}
|
@@ -31,6 +38,7 @@ async function update{{makePlural(entityName)}}(updateRecords, fkFilter, trx, op
|
|
31
38
|
{% endif %}
|
32
39
|
{% endfor %}
|
33
40
|
})
|
41
|
+
{% endif %}
|
34
42
|
|
35
43
|
let records = await Promise.resolve(this.entities.{{table.modelName}}.extensions.onUpdate.records.call(this, updateRecords, opts));
|
36
44
|
|