Skip to content
Snippets Groups Projects
Commit 00b5bd9c authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Add route /idhmr/years

parent 16832150
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!67#296: Nova resposta para os anos da API
Pipeline #
......@@ -41,6 +41,24 @@ idhmrApp.get('/year_range', (req, res, next) => {
next();
}, query, response('range'));
idhmrApp.get('/years', (req, res, next) => {
req.sql.from('adh_idh')
.field('DISTINCT adh_idh.ano_censo', 'year');
next();
}, query, (req, res, next) => {
req.oldResult = req.result;
req.sql = squel.select();
req.sql.from('adh_idh_uf')
.field('DISTINCT adh_idh_uf.ano_censo', 'year');
next();
}, query, (req, res, next) => {
let result = Object.assign(req.oldResult, req.result);
req.result = result;
next();
}, response('years'));
rqf.addField({
name: 'filter',
field: false,
......
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