separate collection and wagon
This commit is contained in:
parent
42e6c223e9
commit
8e9f736cde
|
@ -2,25 +2,20 @@ const express = require('express');
|
|||
const router = express.Router(); // eslint-disable-line
|
||||
// const filter = require('../utilities/filter');
|
||||
const select = require('../db/selectDB');
|
||||
const maxWagon = require('../db/maxWagon');
|
||||
|
||||
router.get('/:collectionFk', async(req, res) => {
|
||||
// var shelving = "BCD";///introducida por el usuario O en leida de la bbdd?
|
||||
// var collectionFk = '273449';
|
||||
const collectionFk = req.params.collectionFk;
|
||||
ticketCollection(collectionFk);
|
||||
router.get('/:collectionShelving', async(req, res) => {
|
||||
const collectionShelving = req.params.collectionShelving.split(',');
|
||||
let collectionFk = 273449;
|
||||
ticketShelving(collectionShelving, collectionFk);
|
||||
res.json({message: 'SUCCESS'});
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
||||
function ticketCollection(collectionFk) {// parametro collectionFk
|
||||
function ticketShelving(collectionShelving, collectionFk) {// parametro collectionFk
|
||||
select.select(collectionFk, function(err, data) {
|
||||
maxWagon.maxWagon(collectionFk, function(err, max) {
|
||||
// aqui iria una función para pedir el numero de shelvings correspondientes
|
||||
let shelving = ['ABC', 'DFG', 'HIJ'];
|
||||
insertTicket(data, shelving, max);
|
||||
});
|
||||
// aqui iria una función para pedir el numero de shelvings correspondientes
|
||||
insertTicket(data, collectionShelving, max);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
const express = require('express');
|
||||
const router = express.Router(); // eslint-disable-line
|
||||
const select = require('../db/selectDB');
|
||||
const maxWagon = require('../db/maxWagon');
|
||||
|
||||
router.get('/:collectionFk', async(req, res) => {
|
||||
// var collectionFk = '273449';
|
||||
const collectionFk = req.params.collectionFk;
|
||||
let maxWagon = ticketCollection(collectionFk);
|
||||
res.json({
|
||||
message: 'SUCCESS',
|
||||
maxWagon: maxWagon
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
||||
function ticketCollection(collectionFk) {// parametro collectionFk
|
||||
select.select(collectionFk, function(err, data) {
|
||||
maxWagon.maxWagon(collectionFk, function(err, max) {
|
||||
return max;
|
||||
});
|
||||
});
|
||||
}
|
|
@ -6,6 +6,7 @@ const logIn = require('./methods/logIn');
|
|||
const dataLogIn = logIn.info;
|
||||
exports.dataLogIn = dataLogIn;
|
||||
|
||||
app.use('/getNumShelving', require('./methods/setCollection'));
|
||||
app.use('/bindShelving', require('./methods/bindShelvingTag'));
|
||||
app.use('/insertTicket', require('./methods/bindTicketShelving'));
|
||||
|
||||
|
|
Reference in New Issue