Use template string to escape literals

This commit is contained in:
Daniel García Aubert 2017-09-14 16:45:45 +02:00
parent 46860541fe
commit 38e2c040d1

View File

@ -292,8 +292,7 @@ module.exports = class Aggregation extends BaseDataview {
search (psql, userQuery, callback) {
const self = this;
const escapedUserQuery = psql.escapeLiteral('%' + userQuery + '%');
const escapedUserQuery = psql.escapeLiteral(`%${userQuery}%`);
const value = this.aggregation !== 'count' && this.aggregationColumn ?
this.aggregation + '(' + this.aggregationColumn + ')' : 'count(1)';