zet-lib 1.0.88 → 1.0.89

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.
Files changed (2) hide show
  1. package/lib/zRoute.js +14 -0
  2. package/package.json +1 -1
package/lib/zRoute.js CHANGED
@@ -1104,15 +1104,28 @@ zRoute.selectAllowedField = (req, res, MYMODEL, arr = []) => {
1104
1104
  arr = fixedArr
1105
1105
  }
1106
1106
 
1107
+ let customs = []
1108
+ for (var key in MYMODEL.widgets) {
1109
+ if (MYMODEL.widgets[key].name == 'custom') {
1110
+ customs.push(key)
1111
+ }
1112
+ }
1113
+ if (customs.length > 0) {
1114
+ arr = arr.filter((item) => !customs.includes(item))
1115
+ }
1107
1116
  return arr
1108
1117
  }
1109
1118
 
1110
1119
  zRoute.excelQuery = async (req, res, MYMODEL, paramsObject = {}) => {
1111
1120
  let virtuals = []
1121
+ let customs = []
1112
1122
  for (var key in MYMODEL.widgets) {
1113
1123
  if (MYMODEL.widgets[key].name === 'virtual') {
1114
1124
  virtuals.push(key)
1115
1125
  }
1126
+ if (MYMODEL.widgets[key].name === 'custom') {
1127
+ customs.push(key)
1128
+ }
1116
1129
  }
1117
1130
  //check directory for import not export
1118
1131
  const dir = `${dirRoot}/public/excel/tmp`
@@ -1146,6 +1159,7 @@ zRoute.excelQuery = async (req, res, MYMODEL, paramsObject = {}) => {
1146
1159
  if (zall) {
1147
1160
  let difference = allfields.filter((x) => !fields.includes(x))
1148
1161
  arr = [...fields, ...difference].filter((x) => !virtuals.includes(x))
1162
+ arr = arr.filter((item) => !customs.includes(item))
1149
1163
  select = `"${arr.join('","')}"`
1150
1164
  }
1151
1165
  let whereArray = []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zet-lib",
3
- "version": "1.0.88",
3
+ "version": "1.0.89",
4
4
  "description": "zet is a library that part of zet generator.",
5
5
  "engines": {
6
6
  "node": ">=18"