corebasic 1.0.126 → 1.0.128

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/libs/elabase.js +11 -8
  2. package/package.json +1 -1
package/libs/elabase.js CHANGED
@@ -103,12 +103,11 @@ export const insert = async (meta, collection, value, _id) => {
103
103
  if (_id)
104
104
  arg._id = _id
105
105
 
106
- if (!(["string", "number"].includes(typeof arg?._id)))
106
+ if (!(["string", "number"].includes(typeof value?._id)))
107
107
  throw {message: "Error: invalid _id in Dip.insert()"}
108
- if (typeof arg?._id === "string" && arg._id.trim().length === 0)
108
+ if (typeof value?._id === "string" && value._id.trim().length === 0)
109
109
  throw {message: "Error: invalid _id in Dip.insert()"}
110
110
 
111
- if ((!arg._id && arg._id !== 0))
112
111
 
113
112
  if (isTransaction) {
114
113
  transactions.push(arg)
@@ -124,11 +123,15 @@ export const insert = async (meta, collection, value, _id) => {
124
123
  }
125
124
 
126
125
  export const query = async (meta, collection, query, options) => {
127
- // Multi Company Support
128
- if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.query()"}
129
- collection = `${meta.company}.${collection}`
130
- if (meta.company !== "GLOBAL")
131
- query.company = meta.company
126
+ if (meta?.USE_EMPTY_COMPANY) {
127
+
128
+ } else {
129
+ // Multi Company Support
130
+ if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.query()"}
131
+ collection = `${meta.company}.${collection}`
132
+ if (meta.company !== "GLOBAL")
133
+ query.company = meta.company
134
+ }
132
135
  // ---------------------
133
136
 
134
137
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corebasic",
3
3
  "type": "module",
4
- "version": "1.0.126",
4
+ "version": "1.0.128",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {