@@ -224,11 +224,11 @@ router.get('/feature', async (req, res) => {
224224 try {
225225 // todo(gis): also implement reference data
226226 if ( get ( req , 'query.resource' ) ) {
227- let id : mongoose . Types . ObjectId ;
227+ let id : string ;
228228 if ( get ( req , 'query.aggregation' ) ) {
229- id = new mongoose . Types . ObjectId ( get ( req , 'query.aggregation' ) ) ;
229+ id = get ( req , 'query.aggregation' ) ;
230230 } else if ( get ( req , 'query.layout' ) ) {
231- id = new mongoose . Types . ObjectId ( get ( req , 'query.layout' ) ) ;
231+ id = get ( req , 'query.layout' ) ;
232232 } else {
233233 return res . status ( 404 ) . send ( i18next . t ( 'common.errors.dataNotFound' ) ) ;
234234 }
@@ -261,9 +261,9 @@ router.get('/feature', async (req, res) => {
261261 let variables : any ;
262262
263263 const aggregations = resourceData . aggregations || [ ] ;
264- const aggregation = aggregations . find ( ( x ) => isEqual ( x . _id , id ) ) ;
264+ const aggregation = aggregations . find ( ( x ) => isEqual ( x . id , id ) ) ;
265265 const layouts = resourceData . layouts || [ ] ;
266- const layout = layouts . find ( ( x ) => isEqual ( x . _id , id ) ) ;
266+ const layout = layouts . find ( ( x ) => isEqual ( x . id , id ) ) ;
267267
268268 // const filterPolygon = getFilterPolygon(req.query);
269269
0 commit comments