q-koa 7.8.2 → 7.8.3

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.
Files changed (2) hide show
  1. package/core/app.js +9 -5
  2. package/package.json +1 -1
package/core/app.js CHANGED
@@ -1472,11 +1472,15 @@ class APP {
1472
1472
  if (omit.length === 0) {
1473
1473
  ctx.SUCCESS(result)
1474
1474
  } else {
1475
- ctx.SUCCESS(
1476
- result.map((target) => {
1477
- return _.omit(target.toJSON(), omit)
1478
- })
1479
- )
1475
+ if (['findAndCountAll', 'findAll'].includes(fn)) {
1476
+ ctx.SUCCESS(
1477
+ result.map((target) => {
1478
+ return _.omit(target.toJSON(), omit)
1479
+ })
1480
+ )
1481
+ } else {
1482
+ ctx.SUCCESS(_.omit(result.toJSON(), omit))
1483
+ }
1480
1484
  }
1481
1485
  } else {
1482
1486
  const rows = await app[appName].model[controller][fn]({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "7.8.2",
3
+ "version": "7.8.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {