diff --git a/bindTicketShelving.js b/bindTicketShelving.js index 591e18d..0a0c237 100644 --- a/bindTicketShelving.js +++ b/bindTicketShelving.js @@ -1,13 +1,14 @@ const insert = require('./insertTicket'); const filter = require('./filter'); -const select = require('./db/selectDB') +//const select = require('./db/selectDB'); +import select from './db/selectDB'; var barcode = "A0A3B820690F"; var shelving = "BCD";///introducida por el usuario O en leida de la bbdd? var collectionFk = '254'; function ticketCollection(collectionFk, shelving){//parametro collectionFk - select.select(collectionFk, function(err,data){ + select(collectionFk, function(err,data){ if(filter.filterShelving(shelving)){ insert.insertTicket(data, shelving) } diff --git a/db/selectDB.js b/db/selectDB.js index 34f270a..85d5a0b 100644 --- a/db/selectDB.js +++ b/db/selectDB.js @@ -1,21 +1,20 @@ const con = require('./connect') -//ticket -//cliente -//agencia -var x; -function select(collectionFk, callback){ +module.exports = function (collectionFk, callback){ let consSql = `SELECT t.id AS Ticket, c.name AS Client, am.name AS Agency, tc.level AS Level FROM ticketCollection tc JOIN ticket t ON t.id = tc.ticketFk JOIN client c ON t.clientFk = c.id JOIN agencyMode am ON am.id = t.agencyModeFk WHERE tc.collectionFk = ${collectionFk}`; + con.con.query(consSql, function (err, result, fields) { console.log(result); callback(null,result); }); } -exports.select = select; +console.log("PROBA"); + + diff --git a/utilities/encrypted.js b/utilities/encrypted.js index 1698c7b..3d17c4a 100644 --- a/utilities/encrypted.js +++ b/utilities/encrypted.js @@ -15,7 +15,3 @@ const encryptPassword = async(password) => { }; exports.encryptPassword = encryptPassword; - - -////hofdsafads -//sadasdas \ No newline at end of file