@dnax/core 0.24.0 → 0.24.2

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.
@@ -944,6 +944,7 @@ class useRest {
944
944
  }),
945
945
  });
946
946
  }
947
+ update = toJson(update);
947
948
 
948
949
  if (col?.hooks?.beforeUpdate && useHook) {
949
950
  await col.hooks.beforeUpdate({
@@ -1082,7 +1083,7 @@ class useRest {
1082
1083
  };
1083
1084
  let col = getCollection(collection, this.#tenant_id);
1084
1085
  if (!col) return fn.error(`Collection ${collection} not found`, 404);
1085
-
1086
+ update = toJson(update);
1086
1087
  let sharedData = {};
1087
1088
  let useHook = options?.useHook ?? this.#useHook;
1088
1089
  if (col?.hooks?.beforeOperation && useHook) {
@@ -1204,6 +1205,7 @@ class useRest {
1204
1205
  let useCustomApi = options?.useCustomApi ?? this.#useCustomApi;
1205
1206
  if (!col) return fn.error(`Collection ${collection} not found`, 404);
1206
1207
  let allFieldKeys = getKeyFields(col);
1208
+ update = toJson(update);
1207
1209
 
1208
1210
  if (col?.hooks?.beforeOperation && useHook) {
1209
1211
  await col.hooks.beforeOperation({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.24.0",
3
+ "version": "0.24.2",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {
package/utils/index.ts CHANGED
@@ -339,7 +339,6 @@ function getEntryBykeys(obj: object = {}, keys: string[] = []) {
339
339
  class ContextError extends Error {
340
340
  code: number;
341
341
  meta: any;
342
-
343
342
  constructor(message: string, code: number, meta?: object) {
344
343
  super(message);
345
344
  this.code = code;
@@ -350,7 +349,7 @@ class ContextError extends Error {
350
349
 
351
350
  const fn = {
352
351
  error: (message: string, code: number, meta?: object) => {
353
- throw new ContextError(message || "", code, meta || {});
352
+ throw new ContextError(message || "", code, meta);
354
353
  },
355
354
  };
356
355