This repository has been archived on 2024-10-02. You can view files and clone it, but cannot push or open issues or pull requests.
smart-tag/methods/setCollection.js

25 lines
703 B
JavaScript
Raw Normal View History

2021-03-18 15:12:45 +00:00
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;
});
});
}