Skip to content

Commit bd9ab7e

Browse files
Fixed the validation of timeseries
1 parent 9948681 commit bd9ab7e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/endpoints/timeseries/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ const pagination = require('jsonapi-pagination');
33
const {RequestError} = require('express-api-server');
44
const paginationHelper = require('../../helpers/pagination');
55

6-
async function validateIndicatorId(req, res, next) {
6+
async function validateTimeseriesId(req, res, next) {
77
try {
8-
await timeseries.exists(req.params.indicator_id);
8+
await timeseries.exists(req.params.indicator_id, true);
99
next();
1010
} catch (err) {
1111
switch (err.constructor.name) {
@@ -55,7 +55,7 @@ module.exports = {
5555
},
5656
'/:indicator_id': (route, urlResolver) => {
5757
route
58-
.get(validateIndicatorId)
58+
.get(validateTimeseriesId)
5959
.get(async (req, res, next) => {
6060
try {
6161
const indicator = await timeseries.get(req.params.indicator_id, urlResolver);
@@ -70,7 +70,7 @@ module.exports = {
7070
},
7171
'/:indicator_id/observations': (route, urlResolver) => {
7272
route
73-
.get(validateIndicatorId)
73+
.get(validateTimeseriesId)
7474
.get(async (req, res, next) => {
7575
try {
7676
const options = {};

0 commit comments

Comments
 (0)