Skip to content

Commit 6906c21

Browse files
committed
fix: could not get map data due to incorrect id check
1 parent 33cea67 commit 6906c21

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/routes/gis/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/schema/query/referenceDatas.query.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const SORT_FIELDS = [
3434
cursorId: (node: any) => node.name,
3535
cursorFilter: (cursor: any, sortOrder: string) => {
3636
const operator = sortOrder === 'asc' ? '$gt' : '$lt';
37-
console.log(decodeCursor(cursor));
3837
return {
3938
name: {
4039
[operator]: decodeCursor(cursor),

src/server/apollo/dataSources.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ export class CustomAPI extends RESTDataSource {
6363
const token: string = await getToken(this.apiConfiguration);
6464
request.headers.set('Authorization', `Bearer ${token}`);
6565
}
66-
console.log(request);
6766
}
6867

6968
/**

0 commit comments

Comments
 (0)