From 79962a7566c8b0fcae84fc6734840c1a726f2766 Mon Sep 17 00:00:00 2001 From: elenatorro Date: Thu, 31 May 2018 19:07:57 +0200 Subject: [PATCH] Refactor long line --- lib/cartodb/backends/layer-stats/mapnik-layer-stats.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cartodb/backends/layer-stats/mapnik-layer-stats.js b/lib/cartodb/backends/layer-stats/mapnik-layer-stats.js index 64e28652..d5f841b8 100644 --- a/lib/cartodb/backends/layer-stats/mapnik-layer-stats.js +++ b/lib/cartodb/backends/layer-stats/mapnik-layer-stats.js @@ -87,7 +87,8 @@ function _aggrFeatureCount(ctx) { function _geometryType(ctx) { if (ctx.metaOptions.geometryType) { const geometryColumn = AggregationMapConfig.getAggregationGeometryColumn(); - return queryUtils.queryPromise(ctx.dbConnection, _getSQL(ctx, sql => queryUtils.getQueryGeometryType(sql, geometryColumn))) + const sqlQuery = _getSQL(ctx, sql => queryUtils.getQueryGeometryType(sql, geometryColumn)); + return queryUtils.queryPromise(ctx.dbConnection, sqlQuery) .then(res => ({ geometryType: res.rows[0].geom_type })); } return Promise.resolve();