@xuda.io/xuda-dbs-plugin-xuda 1.0.72 → 1.0.73

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/package.json +1 -1
  2. package/server.js +3 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-dbs-plugin-xuda",
3
- "version": "1.0.72",
3
+ "version": "1.0.73",
4
4
  "description": "Xuda Database Socket for Xuda's proprietary structure powered by CouchDB",
5
5
  "scripts": {
6
6
  "pub": "npm version patch --force && npm publish --access public"
package/server.js CHANGED
@@ -1000,7 +1000,7 @@ exports.create = async (params, setup_doc, resolve, reject) => {
1000
1000
  doc.udfIndex = index_ret.data;
1001
1001
  const ret = await check_unique(e, doc, table_obj, db, app_id_reference);
1002
1002
  if (ret.code < 0) {
1003
- return ret;
1003
+ return reject(ret.data);
1004
1004
  }
1005
1005
  try {
1006
1006
  const body = await db.insert(doc);
@@ -1009,20 +1009,10 @@ exports.create = async (params, setup_doc, resolve, reject) => {
1009
1009
  return reject(error);
1010
1010
  }
1011
1011
  };
1012
- var ret;
1013
1012
  if (Array.isArray(e.table_data)) {
1014
- ret = await batch();
1015
- if (ret.code < 0) {
1016
- return reject(ret.data);
1017
- }
1018
- return resolve(ret.data);
1019
- }
1020
-
1021
- ret = await single();
1022
- if (ret.code < 0) {
1023
- return reject(ret.data);
1013
+ return await batch();
1024
1014
  }
1025
- resolve(ret.data);
1015
+ return await single();
1026
1016
  };
1027
1017
  exports.read = async (params, setup_doc, resolve, reject) => {
1028
1018
  const e = params.e;