drapi 1.8.50 → 1.8.52

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.
@@ -0,0 +1,21 @@
1
+ [{
2
+ "name":"",
3
+ "host": "",
4
+ "port": 22,
5
+ "username": "",
6
+ "password": "",
7
+ "remotePath": "",
8
+ "localPath": "",
9
+ "disable": false,
10
+ "private_key": "~/.ssh/id_rsa"
11
+ },{
12
+ "name":"",
13
+ "host": "",
14
+ "port": 22,
15
+ "username": "",
16
+ "password": "",
17
+ "remotePath": "",
18
+ "localPath": "",
19
+ "disable": false,
20
+ "private_key": "~/.ssh/id_rsa"
21
+ }]
@@ -35,6 +35,14 @@ class RestController extends BaseController {
35
35
  return ctx.body;
36
36
  }
37
37
 
38
+ async search(ctx) {
39
+ let query = ctx.request.body;
40
+ ctx.query = query;
41
+ delete ctx.query.modifiedBy;
42
+
43
+ return await this.list(ctx);
44
+ }
45
+
38
46
  async detail(ctx) {
39
47
  await this.init(ctx);
40
48
 
@@ -212,7 +220,7 @@ class RestController extends BaseController {
212
220
  registerRouter_() {
213
221
  this.router_.get('/', (ctx) => this.list(ctx));
214
222
  this.router_.get('/:id', (ctx) => this.detail(ctx));
215
- this.router_.get('/search', (ctx) => this.search(ctx));
223
+ this.router_.post('/search', (ctx) => this.search(ctx));
216
224
  this.router_.post('/', (ctx) => this.create(ctx));
217
225
  this.router_.patch('/:id', (ctx) => this.upd(ctx));
218
226
  this.router_.put('/:id', (ctx) => this.upd(ctx));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drapi",
3
- "version": "1.8.50",
3
+ "version": "1.8.52",
4
4
  "description": "Dynamic rest api using mongoDb",
5
5
  "main": "index.js",
6
6
  "scripts": {