adonis-mqcontroller
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -14,16 +14,9 @@ 'use strict' | ||
let {fields, conditions} = body | ||
if(fields){ | ||
this.repository.lookupRecursive(fields); | ||
} | ||
if(!fields){ | ||
return response.status(400).header('message', 'Bad request').json({errors: "yêu cầu có trường fields trong body"}) | ||
if(conditions){ | ||
this.repository.addConditionsObject(conditions); | ||
} | ||
if(!conditions){ | ||
return response.status(400).header('message', 'Bad request').json({errors: "yêu cầu có trường conditions trong body"}) | ||
} | ||
await this.repository.query.lookupRecursive(fields); | ||
await this.repository.query.addConditionsObject(conditions); | ||
/* this.repository.query.setAggregation({ | ||
$project: fields | ||
}) */ | ||
let result = await this.repository.getForReactTable(body, fields); | ||
@@ -30,0 +23,0 @@ //console.log(JSON.stringify(this.repository.query.getAggregation())) |
{ | ||
"name": "adonis-mqcontroller", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "main": "./BaseController.js", |
5137
27