@dnax/core 0.34.0 → 0.36.0
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 +15 -3
- package/package.json +1 -1
package/app/hono.ts
CHANGED
|
@@ -566,16 +566,28 @@ function HonoInstance(): typeof app {
|
|
|
566
566
|
|
|
567
567
|
if (
|
|
568
568
|
col?.api?.fields?.select?.length &&
|
|
569
|
-
Array.isArray(col?.api?.fields?.select
|
|
569
|
+
Array.isArray(col?.api?.fields?.select)
|
|
570
570
|
) {
|
|
571
|
-
|
|
571
|
+
if (body?.withMeta) {
|
|
572
|
+
try {
|
|
573
|
+
response.data = pick(response.data, col?.api?.fields?.select || []);
|
|
574
|
+
} catch (err) {}
|
|
575
|
+
} else {
|
|
576
|
+
response = pick(response, col?.api?.fields?.select || []);
|
|
577
|
+
}
|
|
572
578
|
}
|
|
573
579
|
if (
|
|
574
580
|
col?.api?.fields?.hidden?.length &&
|
|
575
|
-
Array.isArray(col?.api?.fields?.hidden
|
|
581
|
+
Array.isArray(col?.api?.fields?.hidden)
|
|
576
582
|
) {
|
|
577
583
|
let privateFields = col?.api?.fields?.hidden || [];
|
|
578
584
|
privateFields.push("password");
|
|
585
|
+
if (body?.withMeta) {
|
|
586
|
+
// If use Meta are included
|
|
587
|
+
try {
|
|
588
|
+
response.data = omit(response.data, privateFields);
|
|
589
|
+
} catch (e) {}
|
|
590
|
+
}
|
|
579
591
|
response = omit(response, privateFields);
|
|
580
592
|
} else {
|
|
581
593
|
response = omit(response, ["password"]);
|