update files

This commit is contained in:
llopis15 2021-03-12 11:21:41 +01:00
parent dace56596f
commit ac7847c3cc
6 changed files with 18 additions and 42 deletions

View File

@ -0,0 +1,11 @@
const con = require('./connectDB.js')
con.con.connect(function(err) {
if (err) throw err;
console.log("Connected!");
var sql = "INSERT INTO vn.smartTag (code, shelvingFk, `level`) VALUES('A0A3B8200DA9', 'ABC', 2);";
con.con.query(sql, function (err, result) {
if (err) throw err;
console.log("1 record inserted");
});
});

View File

@ -1,6 +1,7 @@
const config = require('./config');
const got = require('got');
function bindShelving(barcode, shelving, level){
const config = require('./config');
const got = require('got');
(async() => {
const info = await config.info
let key = info.data.token;

View File

@ -1,8 +1,6 @@
const insert = require('./insertTicket');
const filter = require('./filter');
var barcode = "A0A3B820690F";
var shelving = "ABC";///introducida por el usuario
var collectionFk = '254';

View File

@ -9,11 +9,4 @@ var con = mysql.createConnection({
port: 3307,
});
exports.con
con.connect(function(err) {
if (err) {
console.error('Error connecting: ' + err.stack);
return;
}
console.log("Connected!");
});
exports.con = con;

View File

@ -1,6 +1,7 @@
const config = require('./config');
const got = require('got');
function insertShelving(shelving, level){
const config = require('./config');
const got = require('got');
(async() => {
const info = await config.info
let key = info.data.token

View File

@ -1,28 +0,0 @@
const mariadb = require('mariadb');
const config = require('./config');
const pool = mariadb.createPool({
host: "test-db.verdnatura.es",
database: "vn",
user: config.userDev,
password: config.passwordDev,
port: 3307,
connectionLimit: 5
});
pool.getConnection()
.then(conn => {
conn.query("SELECT 1 as val")
.then(rows => { // rows: [ {val: 1}, meta: ... ]
return conn.query("INSERT INTO smartTag value (?, ?)", [1, "mariadb"]);
})
.then(res => { // res: { affectedRows: 1, insertId: 1, warningStatus: 0 }
conn.release(); // release to pool
})
.catch(err => {
conn.release(); // release to pool
})
}).catch(err => {
//not connected
});