Skip to content
Snippets Groups Projects
Commit 77196f5e authored by João Victor Tozatti Risso's avatar João Victor Tozatti Risso
Browse files

Fix error in city ibge route

parent 0b0f1646
No related branches found
No related tags found
1 merge request!7Refactor enrollments route to include query building
const express = require('express');
const cityApp = express();
const libs = `${process.cwd()}/libs`;
const log = require(`${libs}/log`)(module);
const squel = require('squel');
const query = require(`${libs}/middlewares/query`);
const response = require(`${libs}/middlewares/response`);
cityApp.get('/', (req, res, next) => {
......@@ -19,7 +23,7 @@ cityApp.get('/:id', (req, res, next) => {
cityApp.get('/ibge/:id', (req, res, next) => {
req.query = squel.select().from('municipios').where('codigo_ibge = ?',
parseInt(req.params.id, 10)).toParam();
req.params.id).toParam();
next();
}, query, response);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment