Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
simcaq-node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simcaq
simcaq-node
Commits
2541d274
There was a problem fetching the pipeline summary.
Commit
2541d274
authored
7 years ago
by
Vytor Calixto
Browse files
Options
Downloads
Plain Diff
Merge branch 'idhme_hotfix' into development
Related:
!71
parents
b65db1d6
294027c0
No related branches found
No related tags found
1 merge request
!116
Release v1.0.0
Pipeline
#
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/libs/routes/idhme.js
+7
-1
7 additions, 1 deletion
src/libs/routes/idhme.js
src/libs/routes/idhml.js
+7
-1
7 additions, 1 deletion
src/libs/routes/idhml.js
src/test/idhme.js
+8
-13
8 additions, 13 deletions
src/test/idhme.js
src/test/idhml.js
+8
-13
8 additions, 13 deletions
src/test/idhml.js
with
30 additions
and
28 deletions
src/libs/routes/idhme.js
+
7
−
1
View file @
2541d274
...
...
@@ -131,7 +131,7 @@ idhmeApp.get('/', rqf.parse(), (req, res, next) => {
.
group
(
'
adh_idh.idhm_e
'
)
.
group
(
'
adh_idh.ano_censo
'
)
.
group
(
'
adh_idh.municipio_id
'
);
}
else
{
}
else
if
((
"
state
"
in
req
.
filter
)
||
(
"
state
"
in
req
.
dims
))
{
req
.
sql
.
from
(
'
adh_idh_uf
'
)
.
field
(
'
adh_idh_uf.idhm_e
'
,
'
total
'
)
.
field
(
'
adh_idh_uf.ano_censo
'
,
'
year
'
)
...
...
@@ -139,6 +139,12 @@ idhmeApp.get('/', rqf.parse(), (req, res, next) => {
.
group
(
'
adh_idh_uf.idhm_e
'
)
.
group
(
'
adh_idh_uf.ano_censo
'
)
.
group
(
'
adh_idh_uf.estado_id
'
);
}
else
{
res
.
status
(
400
);
next
({
status
:
400
,
message
:
'
Wrong/No filter specified
'
});
}
next
();
},
rqf
.
build
(),
query
,
id2str
.
transform
(),
response
(
'
idhme
'
));
...
...
This diff is collapsed.
Click to expand it.
src/libs/routes/idhml.js
+
7
−
1
View file @
2541d274
...
...
@@ -131,7 +131,7 @@ idhmlApp.get('/', rqf.parse(), (req, res, next) => {
.
group
(
'
adh_idh.idhm_l
'
)
.
group
(
'
adh_idh.ano_censo
'
)
.
group
(
'
adh_idh.municipio_id
'
);
}
else
{
}
else
if
((
"
state
"
in
req
.
filter
)
||
(
"
state
"
in
req
.
dims
))
{
req
.
sql
.
from
(
'
adh_idh_uf
'
)
.
field
(
'
adh_idh_uf.idhm_l
'
,
'
total
'
)
.
field
(
'
adh_idh_uf.ano_censo
'
,
'
year
'
)
...
...
@@ -139,6 +139,12 @@ idhmlApp.get('/', rqf.parse(), (req, res, next) => {
.
group
(
'
adh_idh_uf.idhm_l
'
)
.
group
(
'
adh_idh_uf.ano_censo
'
)
.
group
(
'
adh_idh_uf.estado_id
'
);
}
else
{
res
.
status
(
400
);
next
({
status
:
400
,
message
:
'
Wrong/No filter specified
'
});
}
next
();
},
rqf
.
build
(),
query
,
id2str
.
transform
(),
response
(
'
idhme
'
));
...
...
This diff is collapsed.
Click to expand it.
src/test/idhme.js
+
8
−
13
View file @
2541d274
...
...
@@ -70,19 +70,17 @@ describe('request idhme', () => {
chai
.
request
(
server
)
.
get
(
'
/api/v1/idhme?filter=foo:2010,bar:41
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
2
00
);
res
.
should
.
have
.
status
(
4
00
);
res
.
should
.
be
.
json
;
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
total
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
year
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
state_id
'
);
res
.
body
.
should
.
have
.
property
(
'
error
'
);
res
.
body
.
error
.
should
.
be
.
equal
(
'
Wrong/No filter specified
'
);
done
();
});
});
it
(
'
should list idhme with valid dimensions
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/idhme?dims=state
'
)
.
get
(
'
/api/v1/idhme?dims=state
&filter=min_year:2010
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
...
...
@@ -112,17 +110,14 @@ describe('request idhme', () => {
});
});
it
(
'
should
list idhme from all states with all years available with no argument dimensions and
filters
'
,
(
done
)
=>
{
it
(
'
should
return 400 with no
filters
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/idhme
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
2
00
);
res
.
should
.
have
.
status
(
4
00
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
total
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
year
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
state_id
'
);
res
.
body
.
should
.
have
.
property
(
'
error
'
);
res
.
body
.
error
.
should
.
be
.
equal
(
'
Wrong/No filter specified
'
);
done
();
});
});
...
...
This diff is collapsed.
Click to expand it.
src/test/idhml.js
+
8
−
13
View file @
2541d274
...
...
@@ -70,19 +70,17 @@ describe('request idhml', () => {
chai
.
request
(
server
)
.
get
(
'
/api/v1/idhml?filter=foo:2010,bar:41
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
2
00
);
res
.
should
.
have
.
status
(
4
00
);
res
.
should
.
be
.
json
;
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
total
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
year
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
state_id
'
);
res
.
body
.
should
.
have
.
property
(
'
error
'
);
res
.
body
.
error
.
should
.
be
.
equal
(
'
Wrong/No filter specified
'
);
done
();
});
});
it
(
'
should list idhml with valid dimensions
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/idhml?dims=state
'
)
.
get
(
'
/api/v1/idhml?dims=state
&filter=min_year:2010
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
...
...
@@ -112,17 +110,14 @@ describe('request idhml', () => {
});
});
it
(
'
should
list idhml from all states with all years available with no argument dimensions and
filters
'
,
(
done
)
=>
{
it
(
'
should
return 400 with no
filters
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/idhml
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
2
00
);
res
.
should
.
have
.
status
(
4
00
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
total
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
year
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
state_id
'
);
res
.
body
.
should
.
have
.
property
(
'
error
'
);
res
.
body
.
error
.
should
.
be
.
equal
(
'
Wrong/No filter specified
'
);
done
();
});
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment