Skip to content
Snippets Groups Projects
Commit 6d414eda authored by João Victor Risso's avatar João Victor Risso
Browse files

Add query for all regions in the API

parent 06dbecea
No related branches found
No related tags found
No related merge requests found
...@@ -103,9 +103,9 @@ router.get('/enrollments.:format?', function(req, res) { ...@@ -103,9 +103,9 @@ router.get('/enrollments.:format?', function(req, res) {
break; break;
*/ */
case "region": case "region":
if (!id) { // FIXME: parametrized query for all regions is not yet available if (!id) {
enrollmentSql = "SELECT nome AS name, total, ano_inicio AS start_year, ano_fim AS end_year \ enrollmentSql = "SELECT nome AS name, total, ano_inicio AS start_year, ano_fim AS end_year \
FROM matRegiao(1," + start_year + "," + end_year + "," + adm_dependency_id + "," + location_id + ")"; FROM matRegioes(" + start_year + "," + end_year + "," + adm_dependency_id + "," + location_id + ")";
} else { } else {
enrollmentSql = "SELECT nome AS name, total, ano_inicio AS start_year, ano_fim AS end_year \ enrollmentSql = "SELECT nome AS name, total, ano_inicio AS start_year, ano_fim AS end_year \
FROM matRegiao(" + id + "," + start_year + "," + end_year + "," + adm_dependency_id + "," + location_id + ")"; FROM matRegiao(" + id + "," + start_year + "," + end_year + "," + adm_dependency_id + "," + location_id + ")";
......
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