zet-lib 1.2.25 → 1.2.26

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/connection.js CHANGED
@@ -89,7 +89,7 @@ const whereFn = (obj) => {
89
89
  if (type == 'date') {
90
90
  field = item.field.indexOf('.') > -1 ? item.field + '::text ' : ` ${item.field}::text `
91
91
  } else {
92
- field = item.field.indexOf('.') > -1 ? item.field : ` "${item.field}" `
92
+ field = item.field.indexOf('.') > -1 ? item.field : item.field ? ` "${item.field}" ` : ''
93
93
  }
94
94
  //is JSON is field is JSON
95
95
  //JSON_CONTAINS(color, '"Red"' ,'$')
@@ -100,7 +100,11 @@ const whereFn = (obj) => {
100
100
  wherequery += andOr + ` JSON_CONTAINS(${field}, '"${item.value}"' ,'$') ${operator}`
101
101
  } else if (type == 'inline') {
102
102
  //select * from attendance where employee_id = 4803 and date IN ('2023-12-21','2023-12-22')
103
- wherequery += andOr + ` ${field} ${item.value} ${operator}`
103
+ if (field) {
104
+ wherequery += andOr + ` ${field} ${item.value} ${operator}`
105
+ } else {
106
+ wherequery += andOr + ` ${item.value} ${operator}`
107
+ }
104
108
  } else {
105
109
  if (item.option.includes('{{value}}')) {
106
110
  item.option = item.option.replace('{{value}}', `$${increment}`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zet-lib",
3
- "version": "1.2.25",
3
+ "version": "1.2.26",
4
4
  "description": "zet is a library that part of zet generator.",
5
5
  "engines": {
6
6
  "node": ">=18"