@ -1,10 +1,8 @@
'use strict' ;
var Xsql = require ( './xsql.js' ) ;
var whrHelp = require ( './util/whereClause.helper.js' ) ;
var multer = require ( 'multer' ) ;
var path = require ( 'path' ) ;
const colors = require ( 'colors' ) ;
//define class
@ -315,18 +313,6 @@ class Xapi {
}
async distinct ( req , res ) {
let queryParamsObj = { }
queryParamsObj . query = ''
queryParamsObj . params = [ ]
this . mysql . prepareListQuery ( req , res , queryParamsObj , 4 ) ;
let results = await this . mysql . exec ( queryParamsObj . query , queryParamsObj . params ) ;
res . status ( 200 ) . json ( results ) ;
}
async nestedList ( req , res ) {
@ -544,12 +530,29 @@ class Xapi {
async count ( req , res ) {
let query = 'select count(1) as no_of_rows from ??' ;
let params = [ ] ;
let queryParams = { }
params . push ( req . app . locals . _tableName ) ;
queryParams . query = 'select count(1) as no_of_rows from ?? ' ;
queryParams . params = [ ] ;
let results = await this . mysql . exec ( query , params ) ;
queryParams . params . push ( req . app . locals . _tableName ) ;
this . mysql . getWhereClause ( req . query . _where , req . app . locals . _tableName , queryParams , ' where ' )
let results = await this . mysql . exec ( queryParams . query , queryParams . params ) ;
res . status ( 200 ) . json ( results ) ;
}
async distinct ( req , res ) {
let queryParamsObj = { }
queryParamsObj . query = ''
queryParamsObj . params = [ ]
this . mysql . prepareListQuery ( req , res , queryParamsObj , 4 ) ;
let results = await this . mysql . exec ( queryParamsObj . query , queryParamsObj . params ) ;
res . status ( 200 ) . json ( results ) ;
}