corebasic 1.0.105 → 1.0.106

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 +4 -0
  2. package/package.json +1 -1
package/libs/elabase.js CHANGED
@@ -85,6 +85,7 @@ export function transactionCommit(arg) {
85
85
 
86
86
  export const insert = async (meta, collection, value, _id) => {
87
87
  // Multi Company Support
88
+ if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.query()"}
88
89
  collection = `${meta.company}.${collection}`
89
90
  if (meta.company !== "GLOBAL") {
90
91
  if (typeof value === "object" && !Array.isArray(value))
@@ -114,6 +115,7 @@ export const insert = async (meta, collection, value, _id) => {
114
115
 
115
116
  export const query = async (meta, collection, query, options) => {
116
117
  // Multi Company Support
118
+ if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.query()"}
117
119
  collection = `${meta.company}.${collection}`
118
120
  if (meta.company !== "GLOBAL")
119
121
  query.company = meta.company
@@ -154,6 +156,7 @@ function collectionArray(col) {
154
156
 
155
157
  export const update = async (meta, collection, query, update, options) => {
156
158
  // Multi Company Support
159
+ if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.query()"}
157
160
  collection = `${meta.company}.${collection}`
158
161
  if (meta.company !== "GLOBAL") {
159
162
  query.company = meta.company
@@ -183,6 +186,7 @@ export const update = async (meta, collection, query, update, options) => {
183
186
 
184
187
  export const remove = async (meta, collection, query) => {
185
188
  // Multi Company Support
189
+ if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.query()"}
186
190
  collection = `${meta.company}.${collection}`
187
191
  if (meta.company !== "GLOBAL")
188
192
  query.company = meta.company
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corebasic",
3
3
  "type": "module",
4
- "version": "1.0.105",
4
+ "version": "1.0.106",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {