Refactor long line

This commit is contained in:
elenatorro 2018-05-31 19:07:57 +02:00
parent d4c6282455
commit 79962a7566

View File

@ -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();