Remove prefix to context's properties

This commit is contained in:
Daniel García Aubert 2017-09-14 15:27:57 +02:00
parent e2ab48bee2
commit 0a894da0df

View File

@ -283,10 +283,20 @@ const filterCategoriesQueryTpl = ctx => `
const searchQueryTpl = ctx => `
WITH
search_unfiltered AS (
${ctx.searchUnfiltered}
${filterCategoriesQueryTpl({
query: ctx.query,
column: ctx.column,
value: '0',
userQuery: escapedUserQuery
})}
),
search_filtered AS (
${ctx.searchFiltered}
${filterCategoriesQueryTpl({
query: ctx.query,
column: ctx.column,
value: value,
userQuery: escapedUserQuery
})}
),
search_union AS (
SELECT * FROM search_unfiltered
@ -308,18 +318,10 @@ Aggregation.prototype.search = function(psql, userQuery, callback) {
// TODO unfiltered will be wrong as filters are already applied at this point
var query = searchQueryTpl({
searchUnfiltered: filterCategoriesQueryTpl({
query: this.query,
column: this.column,
value: '0',
userQuery: escapedUserQuery
}),
searchFiltered: filterCategoriesQueryTpl({
query: this.query,
column: this.column,
value: value,
userQuery: escapedUserQuery
})
query: this.query,
column: this.column,
value: value,
userQuery: escapedUserQuery
});
debug(query);