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
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
86e05e1f
There was a problem fetching the pipeline summary.
Commit
86e05e1f
authored
7 years ago
by
Vytor Calixto
Browse files
Options
Downloads
Patches
Plain Diff
Change /class to use id2str middleware
cc: @fce15
parent
81986d88
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!116
Release v1.0.0
,
!44
Feature multiple where
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libs/routes/class.js
+23
-46
23 additions, 46 deletions
src/libs/routes/class.js
with
23 additions
and
46 deletions
src/libs/routes/class.js
+
23
−
46
View file @
86e05e1f
...
...
@@ -14,6 +14,8 @@ const response = require(`${libs}/middlewares/response`);
const
ReqQueryFields
=
require
(
`
${
libs
}
/middlewares/reqQueryFields`
);
const
id2str
=
require
(
`
${
libs
}
/middlewares/id2str`
);
let
rqfCount
=
new
ReqQueryFields
();
// Complete range of the enrollments dataset.
// Returns a tuple of start and ending years of the complete enrollments dataset.
...
...
@@ -141,78 +143,53 @@ rqfCount.addField({
}
}).
addValue
({
name
:
'
adm_dependency
'
,
table
:
'
dependencia_adm
'
,
tableField
:
'
id
'
,
resultField
:
'
adm_dependency_
name
'
,
table
:
'
turma
'
,
tableField
:
'
dependencia_adm_
id
'
,
resultField
:
'
adm_dependency_
id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
id
'
},
join
:
{
primary
:
'
id
'
,
foreign
:
'
dependencia_adm_id
'
,
foreignTable
:
'
turma
'
field
:
'
adm_dependency_id
'
}
}).
addValue
({
name
:
'
location
'
,
table
:
'
localizacao
'
,
tableField
:
'
descricao
'
,
resultField
:
'
location_
name
'
,
table
:
'
turma
'
,
tableField
:
'
localizacao_id
'
,
resultField
:
'
location_
id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
id
'
},
join
:
{
primary
:
'
id
'
,
foreign
:
'
localizacao_id
'
,
foreignTable
:
'
turma
'
field
:
'
location_id
'
}
}).
addValue
({
name
:
'
education_level
'
,
table
:
'
etapas_mod_ensino_segmento
'
,
tableField
:
'
id
'
,
resultField
:
'
education_level_
name
'
,
table
:
'
turma
'
,
tableField
:
'
etapas_mod_ensino_segmento_
id
'
,
resultField
:
'
education_level_
id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
id
'
},
join
:
{
primary
:
'
id
'
,
foreign
:
'
etapas_mod_ensino_segmento_id
'
,
foreignTable
:
'
turma
'
field
:
'
etapas_mod_ensino_segmento_id
'
}
}).
addValue
({
name
:
'
adm_dependency_detailed
'
,
table
:
'
dependencia_adm
'
,
tableField
:
'
nome
'
,
resultField
:
'
adm_dependency_detailed_
name
'
,
table
:
'
turma
'
,
tableField
:
'
dependencia_adm_priv
'
,
resultField
:
'
adm_dependency_detailed_
id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
id
'
},
join
:
{
primary
:
'
id
'
,
foreign
:
'
dependencia_adm_priv
'
,
foreignTable
:
'
turma
'
field
:
'
dependencia_adm_priv
'
}
}).
addValue
({
name
:
'
period
'
,
table
:
'
turma
_turno
'
,
tableField
:
'
id
'
,
resultField
:
'
period_
name
'
,
table
:
'
turma
'
,
tableField
:
'
turma_turno_
id
'
,
resultField
:
'
period_
id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
id
'
},
join
:
{
primary
:
'
id
'
,
foreign
:
'
turno
'
,
foreignTable
:
'
turma
'
field
:
'
turma_turno_id
'
}
}).
addValue
({
name
:
'
school
'
,
...
...
@@ -242,6 +219,6 @@ classApp.get('/', rqfCount.parse(), rqfCount.build(), (req, res, next) => {
.
order
(
'
turma.ano_censo
'
)
.
where
(
'
turma.tipo_turma_id = 0 OR turma.tipo_turma_id = 1 OR turma.tipo_turma_id = 2 OR turma.tipo_turma_id = 3
'
);
next
();
},
query
,
response
(
'
class
'
));
},
query
,
id2str
.
transform
(
true
),
response
(
'
class
'
));
module
.
exports
=
classApp
;
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