From 31f1c80b258e959cd1cc32e4bc2be596a17c1e1a Mon Sep 17 00:00:00 2001 From: alexmorenograu <61759297+alexmorenograu@users.noreply.github.com> Date: Mon, 22 Mar 2021 08:50:57 +0100 Subject: [PATCH] params url --- methods/bindShelvingTag.js | 12 ++++++------ methods/bindTicketShelving.js | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/methods/bindShelvingTag.js b/methods/bindShelvingTag.js index 0e25e84..3e4950a 100644 --- a/methods/bindShelvingTag.js +++ b/methods/bindShelvingTag.js @@ -5,12 +5,12 @@ const insertDB = require('../db/insertDB'); const express = require('express'); const router = express.Router(); // eslint-disable-line -router.get('/', async(req, res) => { - // DATOS INTRODUCIDOS POR EL USUARIO - let barcode = 'A0A3B8224DBF'; // valido = "A0A3B82"+ 4 CARACTERES HEXADECIMALES (0-F) - let shelving = 'ABC'; // valido = 3 CARACTERES LETRAS (A-Z) - let level = '4'; - // //////////////////////////////////// +router.get('/:barcode&:shelving&:level', async(req, res) => { + const barcode = req.params.barcode;// valido = "A0A3B82"+ 4 CARACTERES HEXADECIMALES (0-F) + const shelving = req.params.shelving;// valido = 3 CARACTERES LETRAS (A-Z) + const level = req.params.level; + console.log(barcode); + console.log(shelving, level); const result = bindShelvingTag(barcode, shelving, level); if (result == 'INVALID_PLATE') diff --git a/methods/bindTicketShelving.js b/methods/bindTicketShelving.js index d77363d..916d405 100644 --- a/methods/bindTicketShelving.js +++ b/methods/bindTicketShelving.js @@ -3,7 +3,7 @@ const router = express.Router(); // eslint-disable-line // const filter = require('../utilities/filter'); const select = require('../db/selectDB'); -router.get('/:collectionShelving/:collectionFk', async(req, res) => { +router.get('/:collectionShelving&:collectionFk', async(req, res) => { const collectionShelving = req.params.collectionShelving.split(','); const collectionFk = req.params.collectionFk; console.log(collectionShelving); @@ -24,7 +24,7 @@ function ticketShelving(collectionShelving, collectionFk) {// parametro collecti function insertTicket(consultaSql, shelving) { console.log(shelving); console.log('CONSULTASQL:', consultaSql); - console.log('CONSULTASQL_TAMNAÑO:', consultaSql.length); + console.log('CONSULTASQL_TAMAÑO:', consultaSql.length); const dataLogIn = require('../server'); const got = require('got'); (async() => {