Browse Source

Fix : handle ignore tables in xjoin api

pull/13/head
oof1lab 7 years ago
parent
commit
85346e0b2e
  1. 6
      lib/xapi.js

6
lib/xapi.js

@ -410,7 +410,7 @@ class Xapi {
// eg: tbl.tableName // eg: tbl.tableName
let tableNameAndAs = joinTables[index + 1].split('.') let tableNameAndAs = joinTables[index + 1].split('.')
if (tableNameAndAs.length === 2) { if (tableNameAndAs.length === 2 && !(tableNameAndAs[1] in this.config.ignoreTables)) {
queryParamsObj.params.push(tableNameAndAs[1]) queryParamsObj.params.push(tableNameAndAs[1])
queryParamsObj.params.push(tableNameAndAs[0]) queryParamsObj.params.push(tableNameAndAs[0])
} else { } else {
@ -434,7 +434,7 @@ class Xapi {
queryParamsObj.query += ' ?? as ?? ' queryParamsObj.query += ' ?? as ?? '
let tableNameAndAs = joinTables[index].split('.') let tableNameAndAs = joinTables[index].split('.')
if (tableNameAndAs.length === 2) { if (tableNameAndAs.length === 2 && !(tableNameAndAs[1] in this.config.ignoreTables)) {
queryParamsObj.params.push(tableNameAndAs[1]) queryParamsObj.params.push(tableNameAndAs[1])
queryParamsObj.params.push(tableNameAndAs[0]) queryParamsObj.params.push(tableNameAndAs[0])
} else { } else {
@ -444,7 +444,7 @@ class Xapi {
tableNameAndAs = [] tableNameAndAs = []
tableNameAndAs = joinTables[index + 2].split('.') tableNameAndAs = joinTables[index + 2].split('.')
if (tableNameAndAs.length === 2) { if (tableNameAndAs.length === 2 && !(tableNameAndAs[1] in this.config.ignoreTables)) {
queryParamsObj.params.push(tableNameAndAs[1]) queryParamsObj.params.push(tableNameAndAs[1])
queryParamsObj.params.push(tableNameAndAs[0]) queryParamsObj.params.push(tableNameAndAs[0])
} else { } else {

Loading…
Cancel
Save