@dnax/core 0.24.3 → 0.24.5
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 +6 -1
- package/driver/mongo/rest.ts +2 -1
- package/package.json +1 -1
package/app/hono.ts
CHANGED
|
@@ -164,6 +164,11 @@ function HonoInstance(): typeof app {
|
|
|
164
164
|
getPermission(session.get()?.role, tenant_id) ||
|
|
165
165
|
null;
|
|
166
166
|
|
|
167
|
+
if (collection && !col?.slug) {
|
|
168
|
+
c.status(404);
|
|
169
|
+
return c.json({ message: `Collection ${collection} not found` });
|
|
170
|
+
}
|
|
171
|
+
|
|
167
172
|
let nextLifecyle: any = false;
|
|
168
173
|
|
|
169
174
|
// Middleware for apis
|
|
@@ -541,7 +546,7 @@ function HonoInstance(): typeof app {
|
|
|
541
546
|
meta: err?.meta || {},
|
|
542
547
|
};
|
|
543
548
|
if (Cfg.api?.onError && typeof Cfg.api?.onError == "function") {
|
|
544
|
-
await Cfg.api?.onError(errorFormated).catch((err) => {});
|
|
549
|
+
await Cfg.api?.onError(errorFormated).catch((err: any) => {});
|
|
545
550
|
}
|
|
546
551
|
return c.json(errorFormated);
|
|
547
552
|
}
|
package/driver/mongo/rest.ts
CHANGED
|
@@ -95,7 +95,7 @@ class useRest {
|
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
constructor(options: options) {
|
|
98
|
-
this.#c = options
|
|
98
|
+
this.#c = options?.c;
|
|
99
99
|
this.#useCustomApi = options.useCustomApi ?? true;
|
|
100
100
|
this.#tenant_id = options.tenant_id;
|
|
101
101
|
this.#session = null;
|
|
@@ -559,6 +559,7 @@ class useRest {
|
|
|
559
559
|
> {
|
|
560
560
|
return new Promise(async (resolve, reject) => {
|
|
561
561
|
try {
|
|
562
|
+
if (!params) params = {};
|
|
562
563
|
if (options?.cleanDeep) {
|
|
563
564
|
params = cleanDeep(params);
|
|
564
565
|
}
|