q-koa 11.6.2 → 11.7.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.
Files changed (2) hide show
  1. package/core/app.js +5 -1
  2. package/package.json +1 -1
package/core/app.js CHANGED
@@ -1826,6 +1826,7 @@ class APP {
1826
1826
  }
1827
1827
  }
1828
1828
 
1829
+ let createTarget = null
1829
1830
  if (fn === 'upsert' || fn === 'create') {
1830
1831
  if (_.isEmpty(ctx.request.body)) {
1831
1832
  throw new Error('新增不能为空')
@@ -1863,6 +1864,9 @@ class APP {
1863
1864
  : 0,
1864
1865
  ...newData,
1865
1866
  })
1867
+ if (fn === 'create') {
1868
+ createTarget = flag.toJSON ? flag.toJSON() : flag
1869
+ }
1866
1870
  ctx.SUCCESS(flag)
1867
1871
 
1868
1872
  if (cacheModel.includes(controller)) {
@@ -1910,7 +1914,7 @@ class APP {
1910
1914
  }
1911
1915
 
1912
1916
  if (_.get(app, `${appName}.afterExecute.${controller}.${fn}`)) {
1913
- app[appName].afterExecute[controller][fn](ctx)
1917
+ app[appName].afterExecute[controller][fn](ctx, createTarget)
1914
1918
  .then((res) => {
1915
1919
  if (is_dev) {
1916
1920
  console.log('afterUpdate', res)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "11.6.2",
3
+ "version": "11.7.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {