@azteam/express 1.2.124 → 1.2.125

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azteam/express",
3
- "version": "1.2.124",
3
+ "version": "1.2.125",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "repository": {
@@ -14,7 +14,8 @@ class AdminController extends Controller {
14
14
  CREATE: 2,
15
15
  UPDATE: 3,
16
16
  DELETE: 4,
17
- RESTORE: 5
17
+ RESTORE: 5,
18
+ DESTROY: 6
18
19
  }, // system roles
19
20
 
20
21
  paginateOptions: {},
@@ -173,6 +174,23 @@ class AdminController extends Controller {
173
174
  ]
174
175
  };
175
176
  };
177
+
178
+ deleteDestroy() {
179
+ return {
180
+ path: '/destroy/:id',
181
+ method: [
182
+ roleMiddleware([this.options.roles.DESTROY], USER_LEVEL.ADMIN),
183
+ validateMiddleware(REQUEST_TYPE.PARAMS, rulesID),
184
+ async (req, res) => {
185
+ const item = await this.repository.findOneTrashById(req.params.id);
186
+ if (!item) return res.error(NOT_EXISTS);
187
+
188
+ await this.repository.destroy(item);
189
+ return res.success(true);
190
+ }
191
+ ]
192
+ };
193
+ };
176
194
  }
177
195
 
178
196
  export default AdminController;