zet-lib 1.2.13 → 1.2.15

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 +5 -1
  2. package/package.json +2 -2
package/lib/zRoute.js CHANGED
@@ -3399,6 +3399,9 @@ zRoute.import = async (req, res, MYMODEL) => {
3399
3399
  if (keys[prop] == 'id') isInsert = false
3400
3400
  columnCut++
3401
3401
  }
3402
+ if (Object.keys(data).length == 0) {
3403
+ continue
3404
+ }
3402
3405
  try {
3403
3406
  if (isInsert) {
3404
3407
  if (Util.in_array('company_id', fields)) data.company_id = res.locals.companyId
@@ -3479,10 +3482,11 @@ zRoute.tabAccess = async (req, res) => {
3479
3482
  let table = req.body.table
3480
3483
  let roles = myCache.get('ROLES')
3481
3484
  let roleId = res.locals.roleId
3482
- let tabs = roles[roleId].tabs[table] || []
3485
+ let tabs = roles[roleId] && roles.tabs ? roles[roleId].tabs[table] : []
3483
3486
  res.json(tabs)
3484
3487
  } catch (e) {
3485
3488
  console.log(e)
3489
+ io.to(res.locals.token).emit('error', e + '')
3486
3490
  }
3487
3491
  }
3488
3492
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zet-lib",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "description": "zet is a library that part of zet generator.",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -49,4 +49,4 @@
49
49
  "uuid": "^9.0.0",
50
50
  "xlsx": "^0.18.5"
51
51
  }
52
- }
52
+ }