Skip to content
Snippets Groups Projects

Refactor enrollments route to include query building

Merged João Victor Risso requested to merge refactor_enrollments into development
1 file
+ 0
3
Compare changes
  • Side-by-side
  • Inline
+ 0
3
@@ -3,7 +3,6 @@ const cityApp = express();
const libs = `${process.cwd()}/libs`;
const log = require(`${libs}/log`)(module);
const squel = require('squel');
const dbQuery = require(`${libs}/db/query_exec`);
const query = require(`${libs}/middlewares/query`);
const response = require(`${libs}/middlewares/response`);
@@ -19,8 +18,6 @@ cityApp.get('/:id', (req, res, next) => {
}, query, response);
cityApp.get('/ibge/:id', (req, res, next) => {
const citySql = 'SELECT * FROM municipios WHERE codigo_ibge = ?';
const cityIbgeCode = req.params.id;
req.query = squel.select().from('municipios').where('codigo_ibge = ?',
parseInt(req.params.id, 10)).toParam();
next();
Loading