@dnax/core 0.24.0 → 0.24.1
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.
- package/driver/mongo/rest.ts +3 -1
- package/package.json +1 -1
- package/utils/index.ts +1 -2
package/driver/mongo/rest.ts
CHANGED
|
@@ -926,6 +926,7 @@ class useRest {
|
|
|
926
926
|
let allFieldKeys = getKeyFields(col);
|
|
927
927
|
|
|
928
928
|
if (!col) return fn.error(`Collection ${collection} not found`, 404);
|
|
929
|
+
update = toJson(update);
|
|
929
930
|
|
|
930
931
|
if (col?.hooks?.beforeOperation && useHook) {
|
|
931
932
|
await col.hooks.beforeOperation({
|
|
@@ -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
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
|
|