oradm-to-gql 35.0.6 → 35.0.8

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oradm-to-gql",
3
- "version": "35.0.6",
3
+ "version": "35.0.8",
4
4
  "description": "Oracle Data Modeler CSV Export to Apollo GraphQL Endpoint Generator",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -32,24 +32,22 @@ async function create{{makePlural(entityName)}}(createRecords, trx, opts){
32
32
  let allowQuery = await Promise.resolve(this.entities.{{table.modelName}}.extensions.onCreate.allow.call(this, opts));
33
33
 
34
34
  if(!allowQuery) return Promise.resolve([]);
35
-
36
- {% for propName, attrDef in table.attributes %}
37
- {% if attrDef.dataType === 'Boolean' %}
38
- {% set hasBool = "true" %}
39
- {% endif %}
40
- {% endfor %}
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
- })
35
+
36
+ {% for propName, attrDef in table.attributes %}
37
+ {% set doneLoop = 'false' %}
38
+ {% if attrDef.dataType === 'Boolean' and doneLoop !== 'true' %}
39
+ createRecords.forEach(rec => {
40
+ {% for propName, attrDef in table.attributes %}
41
+ {% if attrDef.dataType === 'Boolean' %}
42
+ if (rec.{{attrDef.name}} === null) {
43
+ delete rec.{{attrDef.name}}
44
+ }
45
+ {% endif %}
46
+ {% endfor %}
47
+ })
48
+ {% set doneLoop = 'true' %}
52
49
  {% endif %}
50
+ {% endfor %}
53
51
 
54
52
  let records = await Promise.resolve(this.entities.{{table.modelName}}.extensions.onCreate.records.call(this, createRecords, opts));
55
53
 
@@ -22,23 +22,21 @@ 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" %}
32
- updateRecords.forEach(rec => {
33
- {% for propName, attrDef in table.attributes %}
34
- {% if attrDef.dataType === 'Boolean' %}
35
- if (rec.{{attrDef.name}} === null) {
36
- delete rec.{{attrDef.name}}
37
- }
38
- {% endif %}
39
- {% endfor %}
40
- })
25
+ {% for propName, attrDef in table.attributes %}
26
+ {% set doneLoop = 'false' %}
27
+ {% if attrDef.dataType === 'Boolean' and doneLoop !== 'true' %}
28
+ updateRecords.forEach(rec => {
29
+ {% for propName, attrDef in table.attributes %}
30
+ {% if attrDef.dataType === 'Boolean' %}
31
+ if (rec.{{attrDef.name}} === null) {
32
+ delete rec.{{attrDef.name}}
33
+ }
34
+ {% endif %}
35
+ {% endfor %}
36
+ })
37
+ {% set doneLoop = 'true' %}
41
38
  {% endif %}
39
+ {% endfor %}
42
40
 
43
41
  let records = await Promise.resolve(this.entities.{{table.modelName}}.extensions.onUpdate.records.call(this, updateRecords, opts));
44
42