linter
This commit is contained in:
@@ -6,6 +6,7 @@ const debug = require('debug')('backend:cluster');
|
||||
const AggregationMapConfig = require('../models/aggregation/aggregation-mapconfig');
|
||||
|
||||
module.exports = class ClusterBackend {
|
||||
// jshint maxcomplexity: 17
|
||||
getClusterFeatures (mapConfigProvider, params, callback) {
|
||||
mapConfigProvider.getMapConfig((err, _mapConfig) => {
|
||||
if (err) {
|
||||
@@ -91,9 +92,7 @@ module.exports = class ClusterBackend {
|
||||
return callback(error);
|
||||
}
|
||||
|
||||
for (const [columnName, exp] of Object.entries(expressions)) {
|
||||
const { aggregate_function, aggregated_column } = exp;
|
||||
|
||||
for (const { aggregate_function, aggregated_column } of Object.values(expressions)) {
|
||||
if (typeof aggregated_column !== 'string') {
|
||||
const error = new Error(`Invalid aggregation input, aggregated column should be an string`);
|
||||
error.http_status = 400;
|
||||
@@ -108,7 +107,9 @@ module.exports = class ClusterBackend {
|
||||
}
|
||||
|
||||
if (typeof aggregate_function !== 'string') {
|
||||
const error = new Error(`Invalid aggregation input, aggregate function should be an string`);
|
||||
const error = new Error(
|
||||
`Invalid aggregation input, aggregate function should be an string`
|
||||
);
|
||||
error.http_status = 400;
|
||||
error.type = 'layer';
|
||||
error.subtype = 'aggregation';
|
||||
|
||||
@@ -567,7 +567,7 @@ describe('cluster', function () {
|
||||
});
|
||||
});
|
||||
|
||||
describe.only('invalid aggregation', function () {
|
||||
describe('invalid aggregation', function () {
|
||||
const expectedColumnsError = {
|
||||
errors:[ 'Invalid aggregation input, columns should be and array of column names' ],
|
||||
errors_with_context:[
|
||||
|
||||
Reference in New Issue
Block a user