@dnax/core 0.1.18 → 0.1.20
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/app/hono.ts +1 -1
- package/driver/mongo/rest.ts +3 -3
- package/driver/mongo/utils.ts +0 -12
- package/package.json +1 -1
package/app/hono.ts
CHANGED
|
@@ -372,7 +372,7 @@ function HonoInstance(): typeof app {
|
|
|
372
372
|
|
|
373
373
|
return c.json(response);
|
|
374
374
|
} catch (err: any) {
|
|
375
|
-
if (Cfg?.debug) console.log(err?.message);
|
|
375
|
+
// if (Cfg?.debug) console.log(err?.message);
|
|
376
376
|
if (err?.code && (err?.code < 200 || err?.code > 599)) {
|
|
377
377
|
err.code = 409;
|
|
378
378
|
}
|
package/driver/mongo/rest.ts
CHANGED
|
@@ -85,8 +85,8 @@ class useRest {
|
|
|
85
85
|
let control = {
|
|
86
86
|
error: null,
|
|
87
87
|
value: null,
|
|
88
|
-
waring: null
|
|
89
|
-
}
|
|
88
|
+
waring: null,
|
|
89
|
+
};
|
|
90
90
|
|
|
91
91
|
/* let issue = err?.issues[0] || {};
|
|
92
92
|
let msg = `Field : ${issue?.path[0]?.key} - ${issue?.message}`;
|
|
@@ -1165,7 +1165,7 @@ class useRest {
|
|
|
1165
1165
|
if (Array.isArray(ids)) {
|
|
1166
1166
|
await this.#tenant.database.db?.collection(collection).deleteMany(
|
|
1167
1167
|
{
|
|
1168
|
-
_id: { $in: formatData(ids) },
|
|
1168
|
+
_id: { $in: formatData(ids.map((d) => d?._id || d)) },
|
|
1169
1169
|
},
|
|
1170
1170
|
{
|
|
1171
1171
|
session: this.#session ? this.#session : undefined,
|
package/driver/mongo/utils.ts
CHANGED
|
@@ -225,18 +225,6 @@ function toBson<T>(
|
|
|
225
225
|
function deepSetId(col: Collection, data: any) {
|
|
226
226
|
if (col) {
|
|
227
227
|
col?.fields?.map((f) => {
|
|
228
|
-
if (f?.type == "array" && !data[f?.name]) {
|
|
229
|
-
data[f.name] = [];
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
if (
|
|
233
|
-
f?.type == "relationship" &&
|
|
234
|
-
f?.relationType == "ref-to-many" &&
|
|
235
|
-
!data[f?.name]
|
|
236
|
-
) {
|
|
237
|
-
data[f.name] = [];
|
|
238
|
-
}
|
|
239
|
-
|
|
240
228
|
if (f?.type == "relationship" && data[f.name]) {
|
|
241
229
|
if (typeof data[f.name] == "object" && !Array.isArray(data[f.name])) {
|
|
242
230
|
data[f.name] = data[f.name]?._id || data[f.name]?.id || data[f.name];
|