@azteam/express 1.2.223 → 1.2.224
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/package.json +1 -1
- package/src/AdminController.js +6 -4
package/package.json
CHANGED
package/src/AdminController.js
CHANGED
|
@@ -118,11 +118,11 @@ class AdminController extends Controller {
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
methodPostCreatePublic = async (req, res) => {
|
|
121
|
-
const data = await this.beforeCreate(req.body
|
|
121
|
+
const data = await this.beforeCreate(req.body);
|
|
122
122
|
|
|
123
123
|
let item = await this.repository.createByUser(req.user.id, data);
|
|
124
124
|
|
|
125
|
-
item = await this.afterCreate(item
|
|
125
|
+
item = await this.afterCreate(item);
|
|
126
126
|
|
|
127
127
|
return res.success(item, this.guardResponse, this.allowResponse);
|
|
128
128
|
};
|
|
@@ -147,11 +147,13 @@ class AdminController extends Controller {
|
|
|
147
147
|
let item = await this.repository.findOneById(req.params.id);
|
|
148
148
|
if (!item) return res.error(NOT_EXISTS);
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
const data = await this.beforeModify(req.body);
|
|
151
|
+
|
|
152
|
+
item.loadData(data);
|
|
151
153
|
item.modified_id = req.user.id;
|
|
152
154
|
await item.save();
|
|
153
155
|
|
|
154
|
-
item = await this.afterModify(item
|
|
156
|
+
item = await this.afterModify(item);
|
|
155
157
|
|
|
156
158
|
return res.success(item, this.guardResponse, this.allowResponse);
|
|
157
159
|
};
|