speedly 2.0.21 → 2.0.22
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/dist/cjs/kit/db/db.js +4 -2
- package/dist/esm/kit/db/db.js +4 -2
- package/package.json +1 -1
package/dist/cjs/kit/db/db.js
CHANGED
|
@@ -27,7 +27,7 @@ const usingMongoDb = (collectionName, config = { type: "external" }) => {
|
|
|
27
27
|
__path = config.path;
|
|
28
28
|
model = require(path_1.default.join(...(config.type == "external"
|
|
29
29
|
? [require.main?.filename || "./", __path]
|
|
30
|
-
: ["
|
|
30
|
+
: ["../../model"]), collectionName));
|
|
31
31
|
if (model.default)
|
|
32
32
|
model = model.default;
|
|
33
33
|
const actionHandler = {
|
|
@@ -489,7 +489,9 @@ const usingMongoDb = (collectionName, config = { type: "external" }) => {
|
|
|
489
489
|
}
|
|
490
490
|
if (config?.response) {
|
|
491
491
|
const action = queryState.action?.match(/create|update|delet/i)?.[0] || "find";
|
|
492
|
-
if (queryState.action == "aggregate" &&
|
|
492
|
+
if (queryState.action == "aggregate" &&
|
|
493
|
+
config.first &&
|
|
494
|
+
data[0]?.content.length)
|
|
493
495
|
data[0].content.length = data[0].content[0];
|
|
494
496
|
const resBody = queryState.action == "aggregate"
|
|
495
497
|
? {
|
package/dist/esm/kit/db/db.js
CHANGED
|
@@ -27,7 +27,7 @@ const usingMongoDb = (collectionName, config = { type: "external" }) => {
|
|
|
27
27
|
__path = config.path;
|
|
28
28
|
model = require(path_1.default.join(...(config.type == "external"
|
|
29
29
|
? [require.main?.filename || "./", __path]
|
|
30
|
-
: ["
|
|
30
|
+
: ["../../model"]), collectionName));
|
|
31
31
|
if (model.default)
|
|
32
32
|
model = model.default;
|
|
33
33
|
const actionHandler = {
|
|
@@ -489,7 +489,9 @@ const usingMongoDb = (collectionName, config = { type: "external" }) => {
|
|
|
489
489
|
}
|
|
490
490
|
if (config?.response) {
|
|
491
491
|
const action = queryState.action?.match(/create|update|delet/i)?.[0] || "find";
|
|
492
|
-
if (queryState.action == "aggregate" &&
|
|
492
|
+
if (queryState.action == "aggregate" &&
|
|
493
|
+
config.first &&
|
|
494
|
+
data[0]?.content.length)
|
|
493
495
|
data[0].content.length = data[0].content[0];
|
|
494
496
|
const resBody = queryState.action == "aggregate"
|
|
495
497
|
? {
|